Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable a TabPage in C#

Status
Not open for further replies.

polocar

Programmer
Sep 20, 2004
89
IT
Hello,
I would like to disable a TabPage of a TabControl, but I don't know how to do:

TabPage has two properties (CanFocus and CanSelect), but they are both read-only (so I can't use them).
There is also the Hide() method (I would prefer to disable the TabPage, not make it invisible, but if I have no chance...), but it has no effect (after running the

tp.Hide();

statement, the TabPage is still visible).

Have you any suggestion?
Thank you
 
I have a simular problem with the same thing...
I found a knowledge base article confirming this behivior kb 834616. Is there anyone that knows a way around?
 
For some reason: to hide a TabPage, you have to remove it from the TabControl. You could probably disable any controls that are inside the tabpage, but not the tabpage itself. This said, try putting all the controls in a tabpage into a panel, and disabling the panel.

Let me know if it works
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top