Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing default color for all control buttons on a dialog

Status
Not open for further replies.

rdg2cig

Programmer
Sep 16, 1999
22
US
I changed the dialog box default color in an application I am developing but the buttons are still the default grey.&nbsp;&nbsp;I used the following code in the CMyApp::InitInstance()of the MyApp.cpp file.<br><br>// set the background color for all dialogs to slate blue // with black text<br> SetDialogBkColor(RGB(166, 202, 240), RGB(0, 0, 0));<br><br>How can I change the color of the buttons in my dialog box as well?<br><br>Thank you.
 
Dear rdg2cig,<br><br>I hope you have a good reason for changing the colors. Anyway look in the docs for CWnd::OnCtrlColor()<br><br>Good luck<br>-pete
 
Pete-<br><br>Thank you for your quick response.&nbsp;&nbsp;I looked up the OnCtrlColor() method of CWnd in the help files.&nbsp;&nbsp;Unfortunately, there is no example of its usage.&nbsp;&nbsp;If I want to change the color of the standard OK button provided by a dialog box or the standard buttons provided at the bottom of a set of property sheets, where would I place a call to this method and how would it be used?&nbsp;&nbsp;Would it be in the OnInitDialog() of the dialog class in which the button appears?&nbsp;&nbsp;How is the return handle of the HBRUSH dealt with and how does one get the pDC pointer for the child window?<br><br>Thank you.
 
rdg2cig

Did you get this one sorted out?

Would like to know as the article that Palbano points too is no longer available.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top