Creating textbox style fonts

This is a discussion on Creating textbox style fonts within the C++ Programming forums, part of the General Programming Boards category; I want to create a font that looks like the font in standard textboxes you find on web sites. I ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    731

    Creating textbox style fonts

    I want to create a font that looks like the font in standard textboxes you find on web sites.

    I am using the CreateFont(...) function and I have the font face but it looks nothing like it.

    Is there a easier way to create fonts and get the HFONT handle?

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    You might enjoy something like:

    Code:
    HFONT hFont = static_cast<HFONT>(::GetStockObject(DEFAULT_GUI_FONT));
    There is no need to delete (::DeleteObject(..)) stock objects like the one in the code example.

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    wow I would have never found that. It works PERFECTLY.

  4. #4
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Glad it helped

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 10:38 AM
  2. Creating Fonts in C program
    By AceBlkwell in forum C Programming
    Replies: 8
    Last Post: 11-28-2007, 01:13 PM
  3. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  4. Creating a Carriage-Return style Break in a program
    By JoeMomma5000 in forum C Programming
    Replies: 2
    Last Post: 10-29-2002, 01:06 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM

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