Simple way to change dialog's background and text colors

If you want to change background or text color of your dialog box or form view window you can call CWinApp::SetDialogBkColor(COLORREF clrCtlBk, COLORREF clrCtlText) function. The first argument of the function is background color, second is text color. Call this member function from within the InitInstance member function to set the default background and text color for dialog boxes and message boxes within your application. For example, following code sets all application's dialogs to display a red background and a green text.
BOOL CMyApp::InitInstance()
	// lets set red background and green text for our dialogs
	SetDialogBkColor(RGB(255, 0, 0), RGB(0, 255, 0));

Last updated: 13 May 1998


  • Dragon beats,possibly man tribute tag with the new fad & mundane

    Posted by motherdhmm on 06/04/2013 10:17pm

    [url=]beats by dre[/url] The music, we brute beats differentiate this corresponding exactly art respecting thousands of years seems to include unbreakable pact with humans; it brings more ingenuity on the shock Qiexi, carnival.Whether obsolete or inexperienced, we frightfulness beats dr.dre know there is in every charitable being¡¯s centre the catch of wonders, the unfailing credulous appetite of what are next and the prize of the match of living.Whether getting on in years or sophomoric, we awfulness beats dr.dre know there is in every human being¡¯s heart the coax of wonders, the unfailing ingenuous yearning of what are next and the ecstasy of the meeting of living. [url=]beats by dre[/url] After going because of so numerous products, You forced to be tired, Here we determination not balk you and gratifying to my heinousness beats headphones blog. Word go, I yearn for to felicitate you that you have came to the right home, We sellMonster Beats Nearby Dr. Dre Solo HD headphones Here with special well-disposed of products. Beats dre australia are our latest products, There are a number of assorted styles. Dreadfulness beats alongside dre, Only of the most famous brands, Resolution emit you a feeling of nature, Cardinal you to a world of purity. [url=]beats by dre nz[/url] Metal lamina with B logo ¨C Natural is more non glowing while pretend metal logo looks shiny! Sham has darker blacks and whiter whites! True spar has nicer TYPICAL lighting.we know that the frontage covers are practically identical except for the treatment of the lighting on the headphones.The lighting on the real swaddle have an obvious natural half vicious half grayish touch to it while the counterfeit has a more legitimate pitch black kind-hearted of lighting.

  • readonly

    Posted by Legacy on 10/21/2003 12:00am

    Originally posted by: bruno leclerc

    In OnCtlColor function, I would like to know if the ctrl is readonly or not. How can I do ? GetWindowLong with ES_READONLY seems to not work.

  • Chage Color Of Message WIndow in Vb

    Posted by Legacy on 07/01/2003 12:00am

    Originally posted by: kaleem

    How To Change a any color of message window in vb6

  • Background color of CCeCommandBar

    Posted by Legacy on 05/16/2003 12:00am

    Originally posted by: Guth

    How can i modify the background color of a CCeCommandBar control (gray==>white) ?

  • What about Property Sheets and Property Pages?

    Posted by Legacy on 02/19/2003 12:00am

    Originally posted by: mkubo

    Your instruction works well for dialogs without property sheets and property pages. How can I change the colors of the property sheet and property page tabs? Thanks so much!

  • how to change the dialog box color from dialog box itself(by clicking the button)

    Posted by Legacy on 02/11/2003 12:00am

    Originally posted by: jhansi

    how to change the dialog box color from dialog box itself(by clicking the button)


    Posted by Legacy on 08/25/2002 12:00am

    Originally posted by: Habib Ahmed

    dialog bk color technique

  • Urgent need of help! Pls, tell me how to change color of different dialogs from one place?

    Posted by Legacy on 03/17/2002 12:00am

    Originally posted by: Girija

    I have a dialog displaying various items and I want to provide the facility to add new items by asking for the new item name in a different dialog and also a provision for allowing the selecting an image for that item and add these as new item along with the selected object to the first dialog.
    I am in urgent need of help, Please, help me.

    In advance, thank u.

  • Text Color w/o GUI

    Posted by Legacy on 02/08/2002 12:00am

    Originally posted by: Allan

    Can anyone tell my how to change the color in a C++ program without turning it into a GUI interface. Is this even possible? Any help would be greatly appreciated.

  • colors for visual basic screens

    Posted by Legacy on 01/18/2002 12:00am

    Originally posted by: chandra sekhar.k.

    can any one help me out !!!. I want to change the color for dialog control

  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date