HeaderPane
Main
Hide
Share Link
Print

Selection

One tab of a SftTabs/NET control is the selected tab. Its page is displayed and it is highlighted according to the control's look.

The user selects a tab by clicking it, by using the keyboard (see Keyboard Interface) or by pressing the tab's mnemonic. An application selects a tab using the SftTabs.SelectedIndex or SftTabs.SelectedTab property, the TabClass.Selected property or the TabClass.Select method.

Events

Before another tab is selected, the Switching event occurs. An application can cancel the selection, so the current tab remains selected, or select a different tab instead by setting TabSwitchingEventArgs.NewIndex. The Switching event also occurs when the application selects a tab.

After another tab was selected, the Switched event occurs, followed by the SelectedIndexChanged event.

When the user switches tabs while a control on the current tab page has the input focus, that control is validated first (its Validating event occurs). If validation fails, the tab is not switched and the Switching event does not occur.

When the user clicks a disabled tab, the SwitchingDisabled event occurs and the tab is not selected.

Selection Rules

A hidden tab cannot be selected. A disabled tab cannot be selected by the user, but can be selected by the application.

Until a tab is selected, the control selects the first visible, enabled tab by itself. When the selected tab is removed or hidden, the nearest visible, enabled tab is selected.

A control can be without a selected tab: after the SftTabs.SelectedIndex property is set to -1 (or the SftTabs.SelectedTab property to null/Nothing), the control has no selected tab until a tab is selected again.

See Also Tab Control Components