Indexing Multiple ContainerControls

I have a small ContainerControl (160x143) called groupCtr which contains just a couple of other controls. I need to place 15 of these CC’s on my window. I have created a window-scoped property (cc As groupCtr). In a loop I can create the CC’s by

for i As integer = 0 to 14 cc = New groupCtr(i) cc.embedWithin(Self, x, y) next
The passed param is to create an index property in the CC’s constructor.
OK great! Now. I will need to put data into various of these CC’s as the program progresses.
How do I identify the CC. Say I want to put someData As String in cc #6. Since I could not create an array of these containers, do I have to poll the entire list of CC’s looking for the one with index #6 each time I want to do something with one of them?
How do I identify each of these 15 cc’s on my window?


Although it doesn’t appear here, my email notifications indicated Dave S replied [quote]Use TAG[/quote] So this is in reply to that comment.

Dave, I searched the LR and all I could find was rowTag or other Tag properties that don’t seem to bear on this problem. Could you expound just a bit on what you have in mind? Thanks

Create an array of ContainerControls in a window, from an ancient article:

[code] Function ContainerControls (extends w As Window) as ContainerControl()

dim theList() as ContainerControl
dim o as Runtime.ObjectIterator = Runtime.IterateObjects

while o.MoveNext
if o.Current isA ContainerControl and ContainerControl(o.Current).Window is w then
theList.Append ContainerControl(o.Current)
end if

return theList[/code]

Since you’re using embedwithin, you could also just create an array property on the window:

ctrs() as GroupCtr

And then after the embedWithin:

ctrs.append cc

Then just use a for-next to look through them: