Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using CWnd::SetFont... Limitation On Font Size?

Posted on 1997-05-05
1
Medium Priority
?
955 Views
Last Modified: 2013-12-03
I am using the following code to set the font of a list box control, but it seems to have a limitation on the smallest size the font can have. I need the font to be about halg as large as 12, but if I lower the number below 12 (let's say 1), the font appears with a pixel-size of 12. What's happening? How can I make the font smaller? Also, can different entries in a list box have different fonts (i.e., some bold, others not?)
Thanks. . .

LOGFONT lf;                             // Used to create the CFont.
memset(&lf, 0, sizeof(LOGFONT));        // Clear out structure.
lf.lfHeight = 12;                      // Request a 12-pixel-high font
strcpy(lf.lfFaceName, "Courier");       // Request font
ListBoxFont.CreateFontIndirect(&lf);    // Create the font.
m_capfixture.SetFont(&ListBoxFont);     // set the font
0
Comment
Question by:maknight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
AVaulin earned 60 total points
ID: 1301315
Use LBS_OWNERDRAWxxx style when create ListBoxCtrl. This will help you to draw contents of list box as you want.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question