Bold fonts in Visual Basic 6

Posted on 2005-05-16
Medium Priority
Last Modified: 2013-12-03

I have developed a application in vb6, which will list the fonts currently available on the system. The application displays all the fonts except bold fonts (Arial Bold, Tahoma Bold etc).

I use the following API call

EnumFontFamilies Me.hDC, vbNullString, AddressOf EnumFontFamDisplayProc, List1

Please help.
Question by:LPlate
LVL 14

Accepted Solution

Shiju Sasidharan earned 252 total points
ID: 14012760

Assisted Solution

burningmace earned 248 total points
ID: 14051030
The problem is due to EnumFontFamilies. The function only finds the "main" font (the Big Cheese, the Godfather, whatever) in the family, hence EnumFontFAMILIES. I think you need to use EnumFonts.

Here's a description of the API:

Declare Function EnumFonts Lib "gdi32" Alias "EnumFontsA" (ByVal hDC As Long, ByVal lpsz As String, ByVal lpFontEnumProc As Long, ByVal lParam As Long) As Long

· hdc
Identifies the device context.

· lpFaceName
Points to a null-terminated character string that specifies the typeface name of the desired fonts. If lpFaceName is NULL, EnumFonts randomly selects and enumerates one font of each available typeface.

· lpFontFunc
Points to the application-defined callback function. For more information about the callback function, see the EnumFontsProc function.

· lParam
Points to any application-defined data. The data is passed to the callback function along with the font information.

If the function succeeds, the return value is the last value returned by the callback function. Its meaning is defined by the application.

Hope it helps you fix your problem.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
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…
Suggested Courses
Course of the Month16 days, 15 hours left to enroll

864 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