Search code examples
c#winformstabcontroltabpage

Activate TabPage of TabControl


I am using TabControl in a .NET application. By default, the first tab page of TabControl is showing in form loading. I want to show other tab pages in form loading. Programmatically, how can I show a different tab page?


Solution

  • tabControl1.SelectedTab = MyTab;
    

    or

    tabControl1.SelectedTab = tabControl1.TabPages["tabName"];
    

    Where tabName is the Name of the tab you want to activate (tabName is NOT the text display).