How to Select Tab

raed picture raed · Aug 13, 2015 · Viewed 33.1k times · Source

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

Answer

Amal picture Amal · Aug 13, 2015

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)