June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to retrieve a list of all the fonts on the current computer.
Create a new instance of the System.Drawing.Text.InstalledFontCollection class, which contains a collection of FontFamily objects representing all the installed fonts.
The InstalledFontCollection class allows you to retrieve information about currently installed fonts. The following code uses this technique to fill a list box named lstFonts with a list of valid font names:
Dim FontFamilies As New System.Drawing.Text.InstalledFontCollection()
Dim Family As FontFamily
For Each Family In FontFamilies.Families
lstFonts.Items.Add(Family.Name)
NextWhen an entry is chosen in the list box, the font of a label control is updated:
Private ...
Read now
Unlock full access