Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Select Tab

I have TabControl and 4 TabPages. I need to select the second Tab programmatically!

like image 381
raed Avatar asked Aug 13 '15 14:08

raed


People also ask

How do I select a tab in C#?

You can use the method SelectTab . Show activity on this post. 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 0 to the number of tabs you have minus one).

What is Tab Control in VB net?

The Windows Forms TabControl displays multiple tabs, like dividers in a notebook or labels in a set of folders in a filing cabinet. The tabs can contain pictures and other controls. Use the TabControl to create property pages.


1 Answers

You have two ways to do it

  1. SelectedTab:

    MyTabControl.SelectedTab = MyTabPage (The TabPage you want to select)

  2. SelectedIndex:

    MyTabControl.SelectedIndex = 1 (1 is the index of the second TabPage)

like image 143
Amal Avatar answered Oct 11 '22 14:10

Amal