0

I have a whole bunch of pictureboxes on my form, they have the name picturebox1, picturebox2...picturebox36, and I was wondering if there was a way I could access them using an array. Would I have to create them using a picturebox array and manually type in their locations and such, because I would not like to do that if possible.
Thanks,
Eric Berger

1
Contributor
2
Replies
3
Views
8 Years
Discussion Span
Last Post by eberger2001
0

I found out how to do this:

Public MedalPicBoxes(35) As PictureBox
    Sub InitializePics()
        MedalPicBoxes(0) = PictureBox1
        MedalPicBoxes(1) = PictureBox2
                      ...........
        MedalPicBoxes(34) = PictureBox35
        MedalPicBoxes(35) = PictureBox36
    End Sub
0

I found out how to do this:

Public MedalPicBoxes(35) As PictureBox
    Sub InitializePics()
        MedalPicBoxes(0) = PictureBox1
        MedalPicBoxes(1) = PictureBox2
                      ...........
        MedalPicBoxes(34) = PictureBox35
        MedalPicBoxes(35) = PictureBox36
    End Sub
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.