C# TabPage隐藏问题

TabPage没有Visible属性,所以只能通过设置将其与父控件(tabcontrol)的关联性去除就好了,如下面代码:

this.tclMain.Controls["tpgSize"].Parent = null;
this.tclMain.Controls["tpgColor"].Parent = null;

上述代码将原本是tabcontrol(tclMain)中的两个TabPag(tpgSize, tpgColor)e去掉了

this.tclMain.Controls.Add(tpgSize);

上述代码又将原本tabpage(tpgSize)添加回来

原文地址:https://www.cnblogs.com/rogerroddick/p/2992685.html