How to Loop through controls
Hi,
I can't use the normal method, my controls (picture boxes) names contain numbers such as 00, 01, 02 etc which corrispond to my multidimenional array.
I'm attempting change the picturebox's values in a for loop via the counter in the loop, for example:
Code:
For i = 1 To 4
PictureBox(i).enabled = False 'Picturebox1 will be the first one(counter starts at 1)
Next
I basically need to access each one as I would with an array, I can't type the full names out, can only refer to them via their names + counter number because I don't know what control name I would be dealing with at that time in the loop.
Rep will be provided if can get help, need a easy way to do this.
Re: How to Loop through controls
If you have a multi-dimensional array then why don't you just loop through that?
Re: How to Loop through controls
Ty for reply, Edge.
Quote:
Originally Posted by
jmcilhinney
If you have a multi-dimensional array then why don't you just loop through that?
I'm looping through the array but needed to also loop through the picture boxes in that way and I couldn't see another way of doing it. To access a picture box by it's name and number which corrisponds to the counter in the loop.