Thread: Changing control's font

  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, 08:03 AM
  2. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 10:18 PM
  3. Changing Font (Word COM)
    By UnclePunker in forum Windows Programming
    Replies: 1
    Last Post: 03-22-2004, 11: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, 08: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, 10:31 PM