Displaying all system fonts in a combobox!

This trick show you how to add display all the fonts, which you have installed on your system, in a combobox.
On my computer, it takes some time because I have installed about 1050 fonts but I think most of the computers have about 500 fonts but anyway.
Don't worry if your your computer freezes for some seconds. If you want the fonts to be sorted(A to Z) then set its "sorted" property to true.
Here is the code:

Dim i As Long
Private Sub Form_Load()
For i = 0 To Screen.FontCount - 1
Combo1.AddItem Screen.Fonts(i)
Next
End Sub

You might also like...

Comments

 Abdul

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration.” - E. W. Dijkstra