From Xojo Documentation
|You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!|
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.
This code (in the container's Opening event) displays the panel index of the container: