Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 1997-05-05
1
Medium Priority
?
963 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…

916 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