Arrays, Can you make many Images into an array?

I have 160 images. They are all named Box1 to Box160 (each has a different number). I was wondering if you could change the properties of each box without doing 160 lines of code. Heres what I had in mind but it obviously doesn't work.
-Index is a interger
-boxviz is my array
-Box is the image and index is the number that follows it

For Index = 1 To 160
If boxviz(Index) = 1 Then
Box(Index).Visible = False
End If
Index = Index + 1
Next Index

Help Please!

Comments

  • Try this modified lines of your code:



    For Index = 1 To 160
    Box(Index).Visible = False
    Index = Index + 1
    Next Index
  • Why increase Index twice? The default increase value for a For Next loop is 1 and you also increase by doing Index = Index + 1.

    Ofcourse, don't forget to set the image propery Index for the 160 images you use.

    : Try this modified lines of your code:
    :
    :
    :
    : For Index = 1 To 160
    : Box(Index).Visible = False
    : Index = Index + 1
    : Next Index
    :

    [HR]
    [GREEN]
    roodgebefteblauwebreedbeeldbekbaviaan
    especially for in your kitchen.
    [/GREEN]
    [HR]
    [PURPLE]
    http://www.programmersheaven.com/c/MsgBoard/boardinfo.asp?BoardID=455
    [/PURPLE]
    [HR]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories