Click to See Complete Forum and Search --> : disabling tabs
r0k3t
Jun 21st, 2007, 03:48 PM
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
mikelynch
Jun 21st, 2007, 06:29 PM
try this: button1.TabStop = false;
ComputerJy
Jun 21st, 2007, 07:15 PM
try this: button1.TabStop = false;
A TabPage control is totally different than the "Tab" key.
Anyway, try this 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);
jmcilhinney
Jun 21st, 2007, 07:17 PM
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.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.