Modifying Controls within a loop

Hey guys

Is there a way to modify controls within a loop? For example, let’s say I have 4 rectangles named RECT1, RECT2, RECT3 and RECT4. Instead of modifying all of them individually, is there a way to do it through a loop? Something that would look like:

Dim i as Integer For i = 1 to 4 RECT+i.FillColor = RGB(0, 0, 0) Next

Thanks

Rick

You could make them a control set. That would enable you to run a loop like you posted. Alternately, you can loop over all the controls on the window and match the names.

Thanks Tim for your reply…

But I have another stupid question. How can I create a “Control Set”?

Thanks again

RIck

Set the “Member of” field for each of them to the same thing. There’s a chapter in the User Guide that covers it, but I can’t point you to it off hand.

OK, thanks. I will look into it.

Rick

I posted some simple instructions for this in the other thread with the same title:
here