When a TabPage is not selected it is not Visible and, therefore it is hidden. So the answer to your question would be "select another tabpage or no tabpage at all(SelectedIndex = -1)".
The question you should be asking is "how can I hide the Tab Item ". The answer to this question is that you can't. Instead what you must do is to remove the tabpage from the tabcontrols TabPages collection. This does not destroy the TabPage it simply prevents the Tab Item from showing and prevents the user from being able to select it. Before you reinsert the TabPage you must check that the TabPages() collection does not already contain the tabpage or else a new empty tabpage will be created and all references of the tabpage will then point to that instance.
How can I hide a TabPage?
JEsraelo
Thanks but can you give me some code please
RadioDon
UweM
Justin Burtch
When a TabPage is not selected it is not Visible and, therefore it is hidden. So the answer to your question would be "select another tabpage or no tabpage at all(SelectedIndex = -1)".
The question you should be asking is "how can I hide the Tab Item ". The answer to this question is that you can't. Instead what you must do is to remove the tabpage from the tabcontrols TabPages collection. This does not destroy the TabPage it simply prevents the Tab Item from showing and prevents the user from being able to select it. Before you reinsert the TabPage you must check that the TabPages() collection does not already contain the tabpage or else a new empty tabpage will be created and all references of the tabpage will then point to that instance.
DuvallBuck
Klause
tabPage.Hide();
CYBURT
You'll find code for this as well as just about anything else you can think of to do with TabControls, on my site:
http://www.dotnetrix.co.uk/tabcontrols.html --> Hide and Show Tabpages in a Tabcontrol.