简体   繁体   English

在TabControl(Winforms)中的单个选项卡上设置可见性

[英]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 FK

Times haven't changed since 2.0: 自2.0以来,时间没有改变:

StackOverflow - How to hide TabPage from TabControl StackOverflow-如何从TabControl隐藏TabPage

您可以删除tabControl页面

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

它显然不是标准Windows窗体库的一部分,但是Infragistics UltraTabControl (除其他功能外)还为每个选项卡页提供了Visible属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM