本文介绍了VB.Net 隐藏标签页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里看到了一些关于如何在选项卡控件中隐藏选项卡的讨论,但它们似乎都在 C 或某些变体中.我还没有见过 vb.net 的(我不会做 C)

Ive seen some discussion on here about how to hide tabs in a tabcontrol but they all seem to be in C or some variant. I havent seen one for vb.net (i cant do C)

我想做的是在用户登录之前隐藏或禁用所有选项卡.我已经整理了登录和注销.我需要做的就是添加代码以启用/禁用某些选项卡,直到用户登录.

What i want to do is hide or disable all some of the tabs till the user has logged in.Ive sorted out the login and logout. All i need to do is add the code to enable/disable some tabs until the user has logged in.

有人知道这样做的好方法吗?

Anyone know a good way to do this?

WinForms 顺便说一句

WinForms btw

推荐答案

您只需通过 TabPages 集合从 TabControl 添加和删除 TabPages:

You just add and remove TabPages from the TabControl through the TabPages collection:

TabControl1.TabPages.Add(myTabPage)

并删除它:

TabControl1.TabPages.Remove(myTabPage)

注意:删除 TabPage 不会处理它,它只是从 TabPage 集合中删除它.

Note: Removing a TabPage does not dispose it, it just removes it from the TabPage collection.

这篇关于VB.Net 隐藏标签页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 16:20