Making a Control Array

I think Tim Hare answered this already. Control Sets only work with subclasses of RectControl. ContainerControl is a different beast entirely. Think of it as a “container of controls” rather than an actual control.

Mike, if you want to do it in the IDE try this: //or can be done programmatically
Make a container control call it MyButton
Add 1 button to the container control

Go to the window in question
Add a property MyButtons() As MyButton //optional for speed and ease

Add 10 MyButton to the Window

In the Open event
MyButtons.Append MyButton1
MyButtons.Append MyButton2 //and the rest

Now add a Method ChangeButtonText
For each MB As MyButton in MyButtons
MB.PushButton1.Caption = “New Text”
Next

[quote=18772:@Mike Charlesworth]

All I was saying is that, to me, a control set (Array) fulfils a completely different task to a container.[/quote]

But that’s the point they aren’t arrays, That’s why array methods don’t work with them.

[code]dim ctrls(-1) as MyControl // You could make this a property of your window…
dim y as MyControl

for i=0 to n
y = new MyControl
y.ZIndex = 30
y.Visible = false
addhandler y.MyEvent, addressof MyHandler

ctrls.append y
next[/code]
When you are ready … you can set the visible property to true and set the top, left, width and height properties such that your controls show up on you window where you want them…