subclass variable from superclass issue

i have a container class called supercontainer.
supercontainer contains a button as a control set.
i have a subclass of supercontainer called subcontainer.
i create an array of the subclass subcontainer(0) and subcontainer(1)

everything works fine except, when i click on the button, in the action event i need to get the index of the subcontainer, but the button only sees the supercontainer.

how can i get the index of the subclass or another variable?

You cannot subclass a Container that way. You cannot subclass UI layout. Supercontainer can have logic, but no layout. Subcontainer should have the button in its layout. You can then make instances of Subcontainer.

tim,
that’s what i did. it’s not a layout issue. my superclass has the layout. the subclass is to rearrange the superclass layout for specific needs. everything i’m trying to do is working fine except i need to track the index of the subcontainer to manage a button toggle routine across the different instances.

Superclass cannot have any layout. You will run into issues. This may or may not be one of them, but your subclasses must have their own layout. They cannot “inherit” layout from a superclass.

When you say you create an array of containers, is that a Xojo array variable? Or a “control array”, ie. a control set? If it’s an array variable, you can scan the array for “me”. IndexOf should even work.