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
'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.