Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…

707 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

17 Experts available now in Live!

Get 1:1 Help Now