views:

67

answers:

2

Hai all,

I am using TabControl in c#.NET application.By default first tab page of TabControl is showing in form loading .I want to activate/show other tab pages in form loading. programmatically how can i show other tab page . Please help.

+4  A: 
tabControl1.SelectedTab = MyTab;
testalino
Alternatively, you may also use: **tabControl1.Select("NameOfTabToActivate");**
lucifer
+3  A: 

There are two properties in a TabControl control that manages which tab page is selected.

SelectedIndex which offer the possibility to select it by index (an integer starting from 1 to the number of tabs you have).

SelectedTab which offer the possibility to selected the tab object itself to select.

Setting either of these property will change the currently displayed tab.

Alternatively you can also use the Select method. It comes in three flavour, one where you pass the index of the tab, another the TabPage object itself and the last one a string representing the tab's name.

Gimly