Return PanelIndex at Change event on TabPanel


I have a Window with a TabPanel. I want to run a method when a new Tab is selected. The method is different for each tab so I planned on using a Case on the Panel Index, however I cannot see how to return the PanelIndex without selecting a control on the Tab and I want to run the code at the TabPanel.Change event. Any idea?



clearly documented in the Lang Ref

Thanks Dave, been going round in circles trying to use index property.