如何在 .NET CF 中隐藏选项卡(不仅仅是禁用它)
当选择 TabControl 上的特定选项卡时,我当前使用 TabControl.Enabled = false 禁用所有其他选项卡。 我还想隐藏它们以避免用户感到困惑。
有没有什么方法可以在不删除选项卡然后将它们添加回来的情况下执行此操作?
When a particular tab on a TabControl is selected, I currently disable all other tabs using TabControl.Enabled = false. I would also like to hide them to avoid confusing users.
Is there any way of doing this without removing the tabs and then adding them back in?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试 .Hide() 方法或 .Visible = false,但我还没有测试过。
经过一番谷歌搜索后,似乎无法隐藏单个选项卡。 必须将它们删除并重新添加。
http://social. msdn.microsoft.com/forums/en-US/winforms/thread/aae9149c-4677-46df-b4a2-2f7ec34290a7
www.syncfusion.com/FAQ/windowsforms/faq_c93c.aspx#q957q
You can try the .Hide() method or .Visible = false, however I haven't tested it yet.
After a bit of googling, it appears individual tab's cannot be hidden. They must be removed and re-added.
http://social.msdn.microsoft.com/forums/en-US/winforms/thread/aae9149c-4677-46df-b4a2-2f7ec34290a7
www.syncfusion.com/FAQ/windowsforms/faq_c93c.aspx#q957q
您可以通过从 TabControl 的 TabPages 集合中删除选项卡来轻松隐藏选项卡。 这不会破坏您在 IDE 中构建的 TabPage,因此您只需将它们重新添加到 TabPages 集合即可再次显示它们。
隐藏选项卡:
再次显示同一选项卡:
You can easily hide tab by removing them from the TabPages collection of the TabControl. This doesn't destroy the TabPage that you've build in the IDE, so you can show them again just by re-adding them to the TabPages collection.
Hide a tab:
Show this same tab again: