Results 1 to 3 of 3

Thread: Array of images?

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    7

    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

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Array of images?

    Using an array of image controls you'll have to loop using the index,
    VB Code:
    1. For i = 0 to imgName.Count -1
    2.    imgName.Item(i).Visible = False
    3. 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:
    1. Private Type myCard
    2.   CardPic As Picture
    3.   Number  As Integer
    4.   Color   As Long
    5. End Type
    6.  
    7. Private MyCardArray(50) As myCard
    Last edited by jcis; May 7th, 2006 at 04:23 PM.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    7

    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
  •  



Click Here to Expand Forum to Full Width