Category / Section
How to programmatically select a TabPageAdv in the WinForms TabControlAdv?
1 min read
Select the tabpage
You can select the tab in the TabControlAdv programmatically in any one of the following ways.
1. SelectedTab
2. SelectedIndex
Selected Tab: Gets or sets the currently selected tab.
Selected Index: Gets or sets the currently selected index.
C#
//Selects the second tab by using the property "SelectedTab". this.tabControlAdv1.SelectedTab = this.tabPageAdv2; // Selects the second tab by using the property "SelectedIndex". this.tabControlAdv1.SelectedIndex= 1;
VB
'Selects the second tab by using the property "SelectedTab". Me.tabControlAdv1.SelectedTab = Me.tabPageAdv2 'Selects the second tab by using the property "SelectedIndex". Me.tabControlAdv1.SelectedIndex = 1
Figure 1: Before selecting the TabPageAdv programmatically
Figure 2: After selecting the TabPageAdv programmatically
Samples: