|
-
May 4th, 2000, 08:52 PM
#1
Thread Starter
Lively Member
I have 1 picture box on my form anf would like to create multiple instances of the same picture box and have an array of identical picture boxes... any way to do this since a picture box is not really an object?
-
May 4th, 2000, 09:21 PM
#2
Set the index property of the PictureBox to 0 (zero) to create a control array then use code simular to this to load a new picturebox:
Code:
Private Sub LoadPicBox()
Dim iUBound As Integer
iUBound = Picture1.UBound + 1
Load Picture1(iUBound)
With Picture1(iUBound)
.Top = .Top + .Height * iUBound
.Visible = True
End With
End Sub
Good luck!
PS. How told you that a PictureBox isn't an object? DS.
-
May 4th, 2000, 09:30 PM
#3
Hyperactive Member
Do you want to do it at run time? If so, than set Index property to 0 for your Picture box at design time. At run time put this code at the event you want to this appear:
Code:
Load Picture1(1)
Picture1(1).Top = Picture1(0).Top + Picture1(0).Height
Picture1(1).Visible = True
You can use a loop to load pictures as many as you need.
Sorry, didn't see previous reply
[Edited by LG on 05-05-2000 at 10:31 AM]
-
May 4th, 2000, 09:57 PM
#4
Thread Starter
Lively Member
Thanks guys... I wasn't sure how to create a control array.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|