PDA

View Full Version : Color Dialog Box??...


Lippy
02-28-2006, 06:09 AM
Hey i'm programming in MFC...
How do I change the color of the dialog box??

Melon00
03-06-2006, 07:22 PM
I am not sure if you figured this out yet, but there is a SetDialogBkColor() function you can use to change it. Put the function in the InitInstance() part of your app. Then you have to pass it the color you want by using the RGB(red, green, blue) function. Put integers between 0 and 255 in the red, green and blue parts of the function. You can use MS Paint or some other program to find out what values RGB are on a specific color.

At the end it should look something like this

CTheApp::InitInstance()
{
SetDialogBkColor(RGB(192, 192, 192)); // dark grey
}

Lippy
03-13-2006, 02:41 AM
Hey thanks for the reply,
It's not working tho...I am using VS2003 if that makes any difference?

Kronosoft error C3861: 'SetDialogBkColor': identifier not found, even with argument-dependent lookup


--Thats the error I get??
thanks for the help

Melon00
03-13-2006, 07:16 PM
Make sure you are including stdafx.h. You should have <afxwin.h>, <afxext.h>, <afxcoll.h>, and <afxdisp.h> included within stdafx.h as well.