|
-
Aug 23rd, 2011, 03:45 PM
#1
Thread Starter
Lively Member
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.
-
Aug 23rd, 2011, 09:54 PM
#2
Re: How to Loop through controls
If you have a multi-dimensional array then why don't you just loop through that?
-
Aug 24th, 2011, 05:56 AM
#3
Thread Starter
Lively Member
Re: How to Loop through controls
Ty for reply, Edge.
 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.
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
|