Hi there,
I am trying to figure out how to disable a tab in a tabControl. I thought tab.hide() would do it but that totally has no effect. Am I missing something?
Thanks
Printable View
Hi there,
I am trying to figure out how to disable a tab in a tabControl. I thought tab.hide() would do it but that totally has no effect. Am I missing something?
Thanks
try this:Code:button1.TabStop = false;
A TabPage control is totally different than the "Tab" key.Quote:
Originally Posted by mikelynch
Anyway, try this code:
Code://To remove/hide a TabPage
tabControl1.TabPages.Remove(tabPage2);
//To Show the invisible TabPage again
if ( !tabControl1.TabPages.Contains(tabPage2) )
tabControl1.TabPages.Add(tabPage2);
You cannot hide or disable tabs in a TabControl. You can disable a TabPage but the user can still select that tab; they just can't use any controls on it. If you want to "hide" a TabPage then you have to remove it from the TabControl. You can easily insert it back again later so it's no big deal. If you were to inherit the TabControl you could add functionality to do that internally.