Public Function CreateNewControl(ParentForm As Form, ClassName As String, Name As String) As Object
Set CreateNewControl = ParentForm.Controls.Add(ClassName, Name)
End Function
Dim img(3) As Image
Private Sub Command1_Click()
Set img(0) = CreateNewControl(Form1, "vb.image", "Img0", "Img1", "Img2")
img(0) = LoadPicture("C:\buildings\colosseum\Colosseum08.gif")
img(0).Left = 4080
img(0).Top = 3960
img(0).Height = 1500
img(0).Width = 1500
img(0).Stretch = True
img(0).Visible = True
Code:Public Function CreateNewControl(ParentForm As Form, ClassName As String, Name As String) As Object Set CreateNewControl = ParentForm.Controls.Add(ClassName, Name) End Function Dim img(3) As Image Private Sub Command1_Click() Set img(0) = CreateNewControl(Form1, "vb.image", "Img0", "Img1", "Img2") img(0) = LoadPicture("C:\buildings\colosseum\Colosseum08.gif") img(0).Left = 4080 img(0).Top = 3960 img(0).Height = 1500 img(0).Width = 1500 img(0).Stretch = True img(0).Visible = True