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 need to make the rectangles so that they belong to the same control set. Select one of the rectangles and in the Inspector you will see a popup menu labelled ‘Member Of’. Create a new Control Set and assign it to the other Rectangles.

You can now run code such as:

For i as Integer = 0 to 3 Rectangle1(i).Fillcolor - RGB(0,0,0) Next