Hello,
I was looking for a way to disable a TabPage of a TabControl object.
Do you know if it is possible?
Thank you
Printable View
Hello,
I was looking for a way to disable a TabPage of a TabControl object.
Do you know if it is possible?
Thank you
Welcome to the forums! :wave:
I think that'll do it.Code:MyTabControlTabPages[IndexOfTabToDisable].CanSelect = false;
Unfortunately it doesn't function (CanSelect is a read-only property...)
I also tried with CanFocus property, but it's the same (it's read-only too).
Then, I also tried to use the Hide() method (I would prefer to disable and not to hide the TabPage, however), but the statement has no effect (the TabPage remains visible).
Try this:
tabControl1.TabPages[0].Enabled = false;
Although, the IDE does not give the .Enabled property option, this works.
Thanks
Jemima.
I tried to use the Enabled property in both the ways:
tabControl1.TabPages[0].Enabled = false;
tabPage0.Enabled = false;
Even if "Enabled" isn't a TabPage property, the compiler gives no errors and the program runs (as Jemima said), but the problem is still there: the tabPage isn't disabled...
Oh!! When I tried out, I found all the controls on TabPage1 got disabled.
Well.. let me know if that doesn't happen.. I'll look out if there's an alternate solution.
Jemima.