XtraTabControl.SelectedTabPage Property
Gets or sets the currently selected tab page.
Namespace: DevExpress.XtraTab
Assembly: DevExpress.XtraEditors.v24.2.dll
NuGet Package: DevExpress.Win.Navigation
#Declaration
[DefaultValue(null)]
[DXCategory("Behavior")]
public virtual XtraTabPage SelectedTabPage { get; set; }
#Property Value
Type | Default | Description |
---|---|---|
Xtra |
null | An Xtra |
#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.PageEnabled 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 following code snippet switches 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;
}
#Related GitHub Examples
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.