WinForms Hiding TabControl Headers

后端 未结 4 1707
生来不讨喜
生来不讨喜 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:19

    Here is the simplest solution:

    tabControl.ItemSize = new Size(0, 1);
    tabControl.SizeMode = TabSizeMode.Fixed;
    

    Although the height is being set to 1 pixel, the headers will actually disappear completely when you also use TabSizeMode.Fixed.

    This has worked well for me.

提交回复
热议问题