Steven
Steven

Reputation: 195

Why in Win Classic theme TabControl's background doesn't change the colour?

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 ?

Upvotes: 2

Views: 1500

Answers (3)

S3ddi9
S3ddi9

Reputation: 2151

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

Upvotes: 0

Chibueze Opata
Chibueze Opata

Reputation: 10034

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.

Upvotes: 2

Hans Passant
Hans Passant

Reputation: 942000

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.

Upvotes: 5

Related Questions