在 tabcontrol (winforms) 中设置单个选项卡的可见性
有没有办法设置选项卡控件中单个选项卡的可见性?我认为像这样简单的事情应该有效,但似乎没有任何作用。
tabControl1.TabPages[1].Visible = false;
tabControl1.Refresh();
将有一个始终显示的主选项卡,但我希望有其他可以“打开/关闭”的选项卡。我不想删除选项卡,因为我可能需要再次显示。
妈的
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
自 2.0 以来,时间没有改变:
StackOverflow - 如何从 TabControl 中隐藏 TabPage
Times haven't changed since 2.0:
StackOverflow - How to hide TabPage from TabControl
您可以删除
tabControl
页面You can remove the
tabControl
page它显然不是标准 Windows 窗体库的一部分,但 Infragistics UltraTabControl 具有(除其他功能外)每个选项卡页都有一个 Visible 属性。
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.