See Also Example
Applies To
Printer object, Screen object
Description
Specifies all font names available for the current display device or active printer when enumerated from 0 to FontCount - 1. Not available at design time; read-only at run time.
Usage
{ Printer|Screen}.Fonts(index)
Remarks
The Fonts property works in conjunction with the FontCount Fonts available in Visual Basic vary according to your system configuration, display devices, and printing devices. Use both the Fonts and the FontCount properties to get information about available screen or printer fonts.
Data Type
String
Help:
FontBold, FontItalic, FontStrikethru, FontTransparent, FontUnderline Properties
FontName Property
FontSize Property
TextHeight Method
TextWidth Method
Programmer's Guide:
Chapter 16, "Displaying and Printing Information"
The example prints a list of the printer fonts in a list box. To try this example, paste the code into the Declarations section of a form that has a list box control named List1. Press F5 to run the program and then click the form.
Sub Form_Click ()
Dim I ' Declare variable.
For I = 0 To Printer.FontCount -1 ' Determine number of fonts.
List1.AddItem Printer.Fonts (I) ' Put each font into list box.
Next I
End Sub