怎么禁用或隐藏选项卡中
其中一个tabpage页面

解决方案 »

  1.   

            TabPage tp;
            private void button1_Click(object sender, EventArgs e)
            {
                tp = tabControl1.TabPages[1];
                tabControl1.TabPages.RemoveAt(1);
            }        private void button4_Click(object sender, EventArgs e)
            {
                if(tp!=null)
                    tabControl1.TabPages.Insert(1,tp);
            }
      

  2.   

    只有移除,没有禁用或者隐藏选项如果只想禁用,可以变通一下,临时画个panel覆盖掉原来的内容,
    恢复禁用时,删掉panel
      

  3.   

    实现一个类似于这样的可以关闭的选项卡,然后要禁用,你就通过代码将其关闭就好:
    http://www.codeproject.com/KB/tabs/KRBTabControl.aspx
      

  4.   

            private void tabControl1_Selecting(object sender, TabControlCancelEventArgs e)
            {
                if (e.TabPageIndex == 0)
                    e.Cancel = true;
            }想让tabControl1的TabPageIndex 为0的禁用掉,只要在选择的事件中取消掉就可以了
      

  5.   

    TabPage tp = tabControl1.TabPages[0];
    tabControl1.TabPages.Remove(tp);//隐藏
    tabControl1.TabPages.Insert(0, tp);