1

I have an ATL application with a dialog containing a TAB control. The App uses a common controls manifest.

Under XP with visual styles, the tab control background is a different color than the dialog and the controls (mostly checkboxes), so it looks quite ugly.

Screenshot

How can I fix that?

peterchen
  • 40,917
  • 20
  • 104
  • 186
  • “Perfect” answer for identical problem here: https://stackoverflow.com/questions/27085427/common-controls-are-not-properly-painted-when-i-resize-window/58459674#58459674 – Krishty Oct 19 '19 at 09:17

3 Answers3

6

There is - apparently - one thing to do to get tab control pages colored correctly using XP visual styles.

In the WM_INITDIALOG handler for each page, call the uxtheme API EnableThemeDialogTexture

With the ETDT_ENABLETAB flag this automatically changes the background color of the dialog and all its child controls to paint appropriately on a tab.

The dialog pages do not need any kind of transparent flag, or indeed any style bit set differently from previously. If you have overridden WM_ERASEBKGND or WM_CTLCOLORDLG in your pages DialogProc you will need to revert to default handling (return FALSE).

Chris Becke
  • 34,244
  • 12
  • 79
  • 148
0

Here you could find answer to your question.

Community
  • 1
  • 1
Kirill V. Lyadvinsky
  • 97,037
  • 24
  • 136
  • 212
0

The check boxes will post WM_CTLCOLORBTN notifications to their parent. If, for the checkbox control IDs, the parent window's message handler returns the result of

GetStockObject(HOLLOW_BRUSH)

then the check boxes should be drawn with a transparent background, which should give you the look you want.

DavidK
  • 3,929
  • 1
  • 19
  • 26