how to change font of button's caption using MFC

This is a discussion on how to change font of button's caption using MFC within the Windows Programming forums, part of the Platform Specific Boards category; I need urgent help as i am building a punjabi text editor in vc++ thro' MFC but is unable to ...

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    3

    how to change font of button's caption using MFC

    I need urgent help as i am building a punjabi text editor in vc++ thro' MFC but is unable to change the default font picked up by studio enviorment.

    I simulated a keyboard in dialogbox resource and is facing problem in changing default font for caption of buttons.
    If anyone can tell me how do i change this i'll be very great full

    seeking help

  2. #2
    Registered User
    Join Date
    Apr 2004
    Posts
    3

    how to change font of button's caption

    sir,
    I am simulating a keyboard layout using dialogbox resource in vc++ thro' MFC and facing problem in changing the default font which is picked up by studio. if anyone can help me by telling how to get punjabi or anyother font for the button's caption.
    I am unable to find any property for this.

    seeking help

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,498
    Probable identical questions merged
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Send a WM_SETFONT message to your buttons with CWnd::SendMessage. Use the API function GetStockObject with one of the various *FONT flags (eg. 'DEFAULT_GUI_FONT') for a system font. If you want to create your own font then you'll probably want to fiddle around with an mfc CFont object.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  5. #5
    Registered User
    Join Date
    Apr 2004
    Posts
    3

    not getting properly

    Quote Originally Posted by Ken Fitlike
    Send a WM_SETFONT message to your buttons with CWnd::SendMessage. Use the API function GetStockObject with one of the various *FONT flags (eg. 'DEFAULT_GUI_FONT') for a system font. If you want to create your own font then you'll probably want to fiddle around with an mfc CFont object.

    hello Sir,

    I am sorry i am not getting what u wanna say kindly clarify this.

  6. #6
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,662
    If you didn't understand what Ken posted, or the links to MSDN, then you really shouldn't be writting an application in MFC if you don't know MFC - especially if you're under time constraints.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 05:23 AM
  2. CFontDialog and LOGFONT :: MFC
    By kuphryn in forum Windows Programming
    Replies: 1
    Last Post: 05-25-2002, 10:00 AM
  3. how can i change my caption?
    By cozman in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 10-19-2001, 01:09 PM
  4. Replies: 2
    Last Post: 09-04-2001, 02:12 PM
  5. is there a way to set a pixel or change font color?
    By Flikm in forum C++ Programming
    Replies: 9
    Last Post: 09-01-2001, 01:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21