put an instance of the tabpanel on that container
now you can dynamically add instances of that container as many times as you want
you can add events, methods & properties (i’d use computed properties) to the container control to expose all the events, properties and methods of the tab panel to the code that uses the container
And now you can place instances at design time or runtime
And you can hook up the events & methods just as if it were JUST a tabPanel
There are some limitations to this approach though as a containerControls EmbedWithinPanel needs the actual tabPenel not a container so it wont work without some extra work
Second way
Put one instance of a tabControl on a layout and make it a control group
Now you can create new instances of tabpanels that are part of that group
The downside is that each of the instances shares ONE event handler so trying to add an event handler at runtime messes with all of them
Third way
I cant write about here
Undocumented API’s and all that
Unfortunately its also the most suitable
I’m not sure if the name changed, but if you’re talking of the control SETS in 2019r1.1 and earlier, then I’m not sure why everyone says that events for control sets are problematic?
The shared event method has an index that passes the control # so you can tell which control called it. If you use the index you can just deal with the control that called the event, or if you ignore it, you can deal with all of them. Very flexible and works great.
How do you figure? I have a control set of a variable number of checkboxes, depending on a number of factors. I think with separate instances it would be a lot more work to create each one on the fly (can that even be done?), with it’s associated properties and events…
Suppose in each of several scenarios I want 3 check boxes
So they are index 0 1 and 2
In one case checkbox index 0 represents “property A”, checkbox index 1 represents “property B”, checkbox index 2 represents “property C”
In another checkbox index 0 represents “property C”, checkbox index 1 represents “property A”, checkbox index 2 represents “property B”
index isnt adequate without some other info (the tag etc) to know which is which
In fact index isnt terribly useful at all
That is my usual experience - others may vary
Since I added them in code, I’m completely in charge of which checkbox is at which index, so no problem in my case. And having a single event handler for all of them is nice and terse (the way I like it!)