Click here to Skip to main content
15,888,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I've been trying to change the background colour of a modal dialog box in Visual C++ 2008.

It ought to be easy (shouldn't it?) but being a bit thick I haven't been able to do it even after searching through documentation in Code Project.

Can anyone tell me how I can create a dialog box with a chosen background colour using the dialog resource editor?

Many thanks in anticipation, tnarb.
Posted
Updated 21-Jun-11 7:27am
v2
Comments
tnarb 21-Jun-11 12:56pm    
Very many thanks for this. It looks exactly what I'm looking for. Regards, David George
Joan M 21-Jun-11 13:24pm    
You are welcome! you should put your comments under the post you want to comment though :-D
tnarb 21-Jun-11 13:57pm    
Many thanks again - it works wonders. Sorry about the wrong post!

1 solution

Take a look here[^], you will find the answer in the topic 4.2.

It is easy, you need only to handle the WM_ERASEBACKGROUND message.

You can't change the dialog background colour using the resource editor... <-- edit.

Hope this helps! :thumbsup:

PS: Anyway, a small google search with "background color dialog visual c++" would have done it...
 
Share this answer
 
v2

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