Click here to Skip to main content
15,887,821 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What controls the background color in a push button on an application wizard generated through an MFC project?

Depending on the application settings I pick I get a different backgound color on my pushbutton in the generated "About" dialog box. In some projects I get the older looking button with a solid backgound color matching the dialog backgound and in others I get a newer looking button with the top half matching the dialog and the bottom half a light blue.
Posted
Updated 7-Dec-10 8:35am
v2
Comments
Slacker007 7-Dec-10 14:35pm    
Renamed the Question title to a shorter/meaningful name. Edited the question to be more readable.

I changed the Character Set in the Project Properties from "use Multi-Byte" to "use Unicode" and I got the new colors on my push button control. Go figure.
 
Share this answer
 
The button appearance in MFC is controlled by the current theme running on the underlying OS (or at least it used to be that way a few years ago).

If it's still that way, if you want to change a button's appearance, you have derive a new class and override the OnPaint event.
 
Share this answer
 
Comments
William Arnold 7-Dec-10 16:37pm    
That's how I remember it too but it appears to be different now with the Office and Visual Studio visual styles and colors and the Advanced Features. I seem to be getting different pushbutton backgrounds and styles in resource created dialogs depending on the application settings in the wizard. I just wondered if their is a chart or docoumentation on what gets generated based on the settings.
#realJSOP 7-Dec-10 17:33pm    
It should still work the same way. You can always turn off Windows theme support in the app.

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



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