Thread: All my controls text is bold!

  1. #1
    Registered User
    Join Date
    Mar 2007

    All my controls text is bold!


    Oddly, the text on my buttons and in my edit boxes has all turned out bold. It there any way to rectify this? Here is the code is used to create a button:

            HWND SaveBtn;
            SaveBtn = CreateWindow("BUTTON","&Save", WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON,
                                   x+240,y+280,40,25,//x = 15, y = 70
                                   (HMENU)BN_SAVE, //1102 is id
    I'm only a beginner to windows programming, so I cannot spot any problem.

  2. #2
    Join Date
    Jan 2002
    Controls created within the context of a dialog resource have the font of that dialog, controls created with CreateWindowEx have a different system font.

    To change the font of any control, send a WM_SETFONT message; to duplicate the 'typical' resource dialog based controls use:
    See GetStockObject for further information.

    You can enumerate child windows to set the fonts of multiple controls as described in this thread.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User
    Join Date
    Mar 2007
    Thanks! It works; thanks!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. My text doesn't display
    By joeprogrammer in forum Game Programming
    Replies: 11
    Last Post: 02-23-2006, 10:01 PM
  2. Text adventure engine idea. thoughts?
    By suzakugaiden in forum Game Programming
    Replies: 16
    Last Post: 01-15-2006, 05:13 AM
  3. A bunch of Linker Errors...
    By Junior89 in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2006, 02:59 PM
  4. Replies: 1
    Last Post: 07-13-2002, 05:45 PM
  5. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 09:45 PM