Simple way to change dialog's background and text colors


Full Text Search: The Key to Better Natural Language Queries for NoSQL in Node.js

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


  • 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

  • And.. How Can I do the same but without MFC (Using API only)

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

    Originally posted by: Hector

    I work win Win32 API.. How Can I change the back color of a dialog??

  • Loading, Please Wait ...

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

Top White Papers and Webcasts

  • As all sorts of data becomes available for storage, analysis and retrieval - so called 'Big Data' - there are potentially huge benefits, but equally huge challenges...
  • The agile organization needs knowledge to act on, quickly and effectively. Though many organizations are clamouring for "Big Data", not nearly as many know what to do with it...
  • Cloud-based integration solutions can be confusing. Adding to the confusion are the multiple ways IT departments can deliver such integration...

Most Popular Programming Stories

More for Developers

RSS Feeds

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