Nearly every text editor needs a combo box listing all the fonts installed on the PC, so the user can choose what font some text appears in. Fortunately, this is very simple in VB, using the Screen.Fonts() array. You could also use the Printer.Fonts() array to list the available printer fonts.
Private Sub Form_Load()
Dim I As Integer ' Declare variable.
For I = 0 To Screen.FontCount -1 ' Determine number of fonts.
List1.AddItem Screen.Fonts
(I) ' Put each font into list box.
Next I
End Sub
Comments