Solved

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

Posted on 1997-05-05
1
922 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
method notes when mouse over in eclipse 5 87
Google Chrome color inconsistency 2 70
Excel file not created as expected 7 79
I could not set window to top 4 22
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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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…

830 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