|
-
May 6th, 2006, 08:35 PM
#1
Thread Starter
New Member
Array of images?
Using VB 5.0
I have an array of image controls on a form indexed from 1 to 50. Each has a unique picture in it. Rather than making them all imgName.visible = False, I would like to place them into an array, but I have no idea what data type to declare the array as!? Can this be done, or should I leave well enough alone and just use the control array? It just seems cleaner to get all those controls off the form. Thanks in advance,
Bart
-
May 6th, 2006, 08:55 PM
#2
Re: Array of images?
Using an array of image controls you'll have to loop using the index,
VB Code:
For i = 0 to imgName.Count -1
imgName.Item(i).Visible = False
Next
Or you could use an Array of Pictures if you want (Dim ArrPic(50) as Picture), it depends on how you want to use it.
If you need some extra properties you can use an UDT.. example with cards
VB Code:
Private Type myCard
CardPic As Picture
Number As Integer
Color As Long
End Type
Private MyCardArray(50) As myCard
Last edited by jcis; May 7th, 2006 at 04:23 PM.
-
May 6th, 2006, 09:10 PM
#3
Thread Starter
New Member
Re: Array of images?
Thank you...this will work!
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
|