C# TabControl TabPage Change

Goober picture Goober · May 6, 2009 · Viewed 49.6k times · Source

How do I change the tabpage being displayed in my tabcontrol programmatically?

Answer

Joshua Belden picture Joshua Belden · May 6, 2009

Either by tabControl1.SelectedIndex which is an integer or if you have a reference to a particular tab, tabControl1.SelectedTab.

If you wanted the first one selected:

tabControl1.SelectedIndex = 0;