0

Is there a way to set the visibility of a single tab in a tabcontrol? I thought something simple like this should work, but does not seem to to anything.

tabControl1.TabPages[1].Visible = false;  
tabControl1.Refresh();

There will be a main tab that always shows but I want to have other tabs that I can "turn on\off". I don't want to remove the tabs since I may need to show then again.

fk

Gern Blanston
  • 42,482
  • 19
  • 50
  • 64
  • Duplicate of http://stackoverflow.com/questions/552579/how-to-hide-tabpage-from-tabcontrol (as per Philip's response below) – Gern Blanston Oct 22 '09 at 18:12

3 Answers3

1

Times haven't changed since 2.0:

StackOverflow - How to hide TabPage from TabControl

Community
  • 1
  • 1
Philip Wallace
  • 7,905
  • 3
  • 28
  • 40
1

You can remove the tabControl page

this.tControl1.TabPages.Remove(this.tControl1.TabPages["tabPageName"]);
stealthyninja
  • 10,343
  • 11
  • 51
  • 59
Alll
  • 11
  • 2
0

It's obviously not part of the standard Windows Forms library, but the Infragistics UltraTabControl has (among other features) a Visible property for each tab page.

Adam Neal
  • 2,147
  • 7
  • 24
  • 39