WinForms Hiding TabControl Headers

后端 未结 4 1705
生来不讨喜
生来不讨喜 2020-12-06 02:16

I need some way to hide the headers of a TabControl (I\'ll be switching the selected tab programatically). How can I do this?

4条回答
  •  醉梦人生
    2020-12-06 02:20

    Remove or add the TabPage

        void Toggle()
        {
            if (tabControl1.TabPages.Contains(tabPage1))
                tabControl1.TabPages.Remove(tabPage1);
            else
                tabControl1.TabPages.Add(tabPage1);
        }
    

    Alternative use TabPages.Insert(index, tabPage) if you want to specify the position.

提交回复
热议问题