1

In Win7 theme it works good, but in win classic theme it looks weird.

In Win 7 theme : enter image description here

In Win Classic theme:

enter image description here

Is there any chance to fix this ?

Steven
  • 185
  • 1
  • 5
  • 11

3 Answers3

5

This is by design. It doesn't have anything to do with "change the colour", it is actually a transparency effect. The window is rectangular and not shaped to fit the tabs. The control first paints the space for the tabs by asking the parent window to draw itself, passing its own window handle. Then draws the tabs on top of that. You can see this by setting the parent's BackgroundImage property. Also the way that, say, the Label and PictureBox controls simulate transparency.

This is behavior implemented by the visual styles renderer. Windows Classic doesn't use any transparency effects.

If this is really important to you then do consider WPF. It doesn't use a window for its controls and is thus not affected by the selected theme.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
1

If you really want your own style-independent customized tab, draw the tab yourself using OwnerDrawFixed. See an example on codeproject.

Custom Tab Control by Curtis Schlak.

Chibueze Opata
  • 9,856
  • 7
  • 42
  • 65
0

Its the same question as go to How to change the background color of unused space tab in C# winforms?

you've to overload the OnPaintBackground method

Community
  • 1
  • 1
S3ddi9
  • 2,121
  • 2
  • 20
  • 34