Click here to Skip to main content
15,846,346 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
It's minor, but the kind of thing that bugs me.

I have a CStatusBar on a dialog, on which I have other controls (Toolbar, ActiveX etc.). I've set my other controls background colour to blend with the default dialog colour (COLOR_3DFACE). On my system that is RGB(240, 240, 240).

However, the background colour of the statusbar (which I haven't set) is RGB(241, 237, 237)? Why is this? Can I change the default?

What I have tried:

I tried:
COLORREF cr = ::GetSysColor(COLOR_3DFACE);
It doesn't make any difference.
Updated 20-Dec-17 10:16am
Richard MacCutchan 20-Dec-17 4:33am    
Try a very different colour, like RED, to see if the change actually happens. Some colours are so close to each other it is difficult to see the changes.
Kyudos 20-Dec-17 15:14pm    
Setting the background colour doesn't seem to work at all, even setting to red. Obviously the colours involved aren't that different, but they are different enough for me to notice. Don't think it's worth owner-drawing the panels just for this though.
Richard MacCutchan 20-Dec-17 15:42pm    
The documentation says it can be done: CStatusBarCtrl Class[^]. Are ypou sure that your code is not resetting it somehow?

1 solution

An example for what Richard mentioned:

This Background is RGB 240,240,240
This Background is RGB 237,237,241
This Background is RGB 224,224,224
This Background is RGB 255,0,0

Pay Attention, COLORREF is 0x00bbggrr (COLORREF (Windows)[^]) while in the html-div I used it is 0xrrggbb.

I would have posted this as comment, but comments do not handle the div's. Sorry.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900