Articles in this section
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

Before selecting the TabPageAdv programmatically

Figure 1: Before selecting the TabPageAdv programmatically

 

After selecting the TabPageAdv programmatically

Figure 2: After selecting the TabPageAdv programmatically

Samples:

C#: TabControlAdv_Selection_C#

VB: TabControlAdv_Selection_VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied