Skip to main content

XtraTabControl.SelectedTabPage Property

Gets or sets the currently selected tab page.

Namespace: DevExpress.XtraTab

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DefaultValue(null)]
[DXCategory("Behavior")]
public virtual XtraTabPage SelectedTabPage { get; set; }

Property Value

Type Default Description
XtraTabPage null

An XtraTabPage object which represents the tab page currently selected.

Remarks

Read this property’s value to determine which tab page is currently selected. Assign a tab page to this property to select it.

Disabled tab pages (pages whose XtraTabPage.Enabled property is set to false) cannot be selected. If the tab control does not own any pages, the SelectedTabPage property returns a null reference.

When the SelectedTabPage property value changes, the XtraTabControl.SelectedPageChanged event raises.

The code sample below illustrates how switch active tabs with CTRL+1 and CTRL+2 key combinations.

xtraTabControl1.KeyDown += XtraTabControl1_KeyDown;

private void XtraTabControl1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.D1 && e.Control)
        this.xtraTabControl1.SelectedTabPage = xtraTabPage1;
    if (e.KeyCode == Keys.D2 && e.Control)
        this.xtraTabControl1.SelectedTabPage = xtraTabPage2;
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the SelectedTabPage property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also