Click here to Skip to main content
15,890,438 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:
C++
m_Status.GetStatusBarCtrl().SetBkColor(CLR_DEFAULT);
and
C++
COLORREF cr = ::GetSysColor(COLOR_3DFACE);
m_Status.GetStatusBarCtrl().SetBkColor(cr);
It doesn't make any difference.
Posted
Updated 20-Dec-17 9:16am
v3
Comments
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
 
v2

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