I am using TabControl in #.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?
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).
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With