Gern Blanston
Gern Blanston

Reputation: 42660

Set visibility on single tab in tabcontrol (winforms)

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

Upvotes: 0

Views: 13382

Answers (3)

Alll
Alll

Reputation: 11

You can remove the tabControl page

this.tControl1.TabPages.Remove(this.tControl1.TabPages["tabPageName"]);

Upvotes: 1

Adam Neal
Adam Neal

Reputation: 2177

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.

Upvotes: 0

Philip Wallace
Philip Wallace

Reputation: 8015

Times haven't changed since 2.0:

StackOverflow - How to hide TabPage from TabControl

Upvotes: 1

Related Questions