Changing control's font

This is a discussion on Changing control's font within the Windows Programming forums, part of the Platform Specific Boards category; Is there a way to change a control's font? Both size, and the font itself. Thanks....

  1. #1
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768

    Changing control's font

    Is there a way to change a control's font?
    Both size, and the font itself.


    Thanks.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    WM_SETFONT to change the font.

    CreateFont or CreateFontIndirect to create a font (gdi) object. GetStockObject will return a couple of system fonts.

    For all fonts you create remember to use DeleteObject when you are finished with them. You don't have to use DeletObject on fonts returned from GetStockObject because they are shared, system resources.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem with my font manager
    By hannibar in forum C Programming
    Replies: 1
    Last Post: 03-07-2006, 07:03 AM
  2. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 09:18 PM
  3. Changing Font (Word COM)
    By UnclePunker in forum Windows Programming
    Replies: 1
    Last Post: 03-22-2004, 10:30 AM
  4. Changing font in rich edit, without affecting undo buffer
    By jverkoey in forum Windows Programming
    Replies: 3
    Last Post: 01-17-2004, 07:54 PM
  5. setting default font to draw all further controls with
    By alandrums in forum Windows Programming
    Replies: 0
    Last Post: 12-03-2001, 09:31 PM

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