Auflistung der installierten bzw. privaten Fonts
Function FontFams(ByVal Ix As Integer) As Array
' Get the array of FontFamily objects.
Dim fontFamilies() As FontFamily
Select Case Ix
Case 1
Dim FontCollection As New InstalledFontCollection()
fontFamilies = FontCollection.Families
Return fontFamilies
Case 2
Dim FontCollection As New PrivateFontCollection()
fontFamilies = FontCollection.Families
Return fontFamilies
Case Else
Return Nothing
End Select
End Function
'Aufruf in ListBox
ListBox1.Items.Clear()
For Each FN As FontFamily In FontFams(1)
ListBox1.Items.Add(FN.Name)
Next
1 Kommentare zum Snippet