Solved

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

Posted on 1997-05-05
1
901 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
1 Comment
 
LVL 4

Accepted Solution

by:
AVaulin earned 20 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 113
sameEnds challenge 3 133
countEvens challenge 2 73
how to split multiple lines delimiter : 8 77
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now