Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 19,893 times

Related Categories

Displaying all system fonts in a combobox!

Abdul

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

Comments

  • Another installed font detection method

    Posted by DarthDemo on 18 Jul 2005

    Another way to check if a font is installed:

    Private Function IsFontInstalled(FaceName As String) As Boolean
    Dim fnt As New StdFont
    ' Try assigning the facename
    fnt.Name = FaceName
    ...

  • Thank You!

    Posted by DCER on 24 Jul 2004

    Thank you, thank you, thank you!

    I've been looking for this. I was sure there has to be a "special" command, but didn't know what it was. You saved me a lot of brain-ache :)