views:

147

answers:

0

I extended the (WindowsForms) built-in TabControl so that users can close 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 a second time as seen in this screenshot (you see it clearly on the selected tab):

TabControl screenshot

That's a problem for two reasons:

  1. It looks ugly on the selected tab
  2. 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?