Increase the tab size in a user-drawn TabControl

By modifying the padding, it is possible to create additional space for multiple icons or other content.

https://docs.microsoft.com/en-us/windows/win32/controls/tab-controls#tab-size-and-position

https://docs.microsoft.com/en-us/windows/win32/controls/tcm-setpadding

https://docs.microsoft.com/en-us/windows/win32/api/_controls/

This is particularly useful in a TabControl with SizeMode = FillToRight because setting ControlStyles.UserPaint to true in the constructor will cause the system to report the size of tabs to match only the text (i.e., the space required for icons is unaccounted for).

My take:

Comments