Skip to main content

DXTabControl.SelectedIndex Property

Gets or sets an index of the selected tab item. This is a dependency property.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v14.2.dll

#Declaration

public int SelectedIndex { get; set; }

#Property Value

Type Description
Int32

A zero-base integer value that specifies the selected tab item's index.

#Remarks

Use the SelectedIndex property to select a tab item by its index within the Items collection. You can also use the DXTabControl.SelectedItem property to select the required tab item. To obtain whether a tab item is selected, use its DXTabItem.IsSelected property.

The tab control allows you to hide individual tab items. Using the SelectedIndex or DXTabControl.SelectedItem properties to select a hidden tab item does nothing. In this instance, use the DXTabControl.ShowTabItem method.

Setting the SelectedIndex property to a new value fires the DXTabControl.SelectionChanging event. This event is raised before a new tab item is selected, allowing you to cancel the action. After the new item has been selected, the DXTabControl.SelectionChanged event is fired.

See Also