WinForms TabControl: How to avoid tab-rendering on DrawMode=OwnerDrawFixed?
- by splattne
I extended the (WindowsForms) built-in TabControl in order to implement closing tabs right on the tab itself ("x" image on the right like in Webbrowsers). The inherited control renders the text and images. Also, it uses visual styles on hover etc.
All works very well, but I have one problem I can't solve. When the tabs are rendered, I cannot avoid that the Control paints the tabs another time as seen in this screenshot:
That's a problem for two reasons:
It looks ugly on the selected tab
I'd like to increase the tabs' width because the current width doesn't take account of the "x" image on the right
Any idea how to solve this?