VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Adding Picture Box Control at Run time

by Bhuwan Chand Joshi (69 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 21st July 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Adding Picture Box Control at Run time

Rate Adding Picture Box Control at Run time



'Run time addition:

'Open a standard exe form

'Type the code given below

Private sub Form_Load()

Dim Obj As Object
Set Obj = Form1.Controls.Add("VB.PictureBox", "Picture1")
Obj.Left = 0
Obj.Top = 0
Obj.Width = Form1.Width / 2
Obj.Height = Form1.Height / 2
Obj.Picture = LoadPicture("Path of the BMP file")
Obj.Visible = True
Set Obj = Nothing

End Sub

'Run the application and you see the Picture box displaying BMP file. over the Picture Box Control. Try to disable it.


Download this snippet    Add to My Saved Code

Adding Picture Box Control at Run time Comments

No comments have been posted about Adding Picture Box Control at Run time. Why not be the first to post a comment about Adding Picture Box Control at Run time.

Post your comment

Subject:
Message:
0/1000 characters