DesktopContainer.PanelIndex
From Xojo Documentation
Property (As Integer )
aDesktopContainer.PanelIndex = newIntegerValue
or
IntegerValue = aDesktopContainer.PanelIndex
New in 2021r3
Supported for all project types and targets.
or
IntegerValue = aDesktopContainer.PanelIndex
New in 2021r3
Supported for all project types and targets.
If the container has been placed on a DesktopTabPanel or DesktopPagePanel control, this is the panel (page/tab) that the container is on.
Notes
The first panel is numbered zero. If the container has been placed on a panel of a DesktopTabPanel or DesktopPagePanel control, it returns the panel number. If the container is not on a DesktopPagePanel or DesktopTabPanel, it returns -1. If you change the PanelIndex to a nonexistent panel, the control will disappear until you give it a PanelIndex value that corresponds to a panel that exists.
If you are looking to change the currently selected panel (page/tab), use DesktopPagePanel.SelectedPanelIndex.
Sample Code
This code (in the container's Opening event) displays the panel index of the container:
MessageBox(Me.PanelIndex.ToString)