|
-
Apr 29th, 2000, 02:33 AM
#1
Thread Starter
Addicted Member
i want to list all fonts of the system in list1
but i dont't know, how to get them
where are they stored...???
-
Apr 29th, 2000, 02:39 AM
#2
Try This. 
Code:
Dim I As Integer
For I = 0 Printer.FontCount -1
List1.AddItem Printer.Fonts(i)
Next
-
Apr 29th, 2000, 03:34 AM
#3
Addicted Member
That will work, but you will only get a list of printable fonts. To get all known fonts (doesn't include GDI synthesized fonts) on the system use the Screen object instead, like this:
Code:
Private Sub ListFonts()
Dim idx As Long
Dim sFont As String
Screen.MousePointer = vbHourglass
List1.Visible = False
Call List1.Clear
For idx = 1 To Screen.FontCount Step 1
sFont = Screen.Fonts(idx)
If sFont <> vbNullString Then
Call List1.AddItem(sFont)
End If
Next idx
List1.Visible = True
Screen.MousePointer = vbDefault
'Just so you can see the comparison.
Call MsgBox("Number of Screen Fonts = " & Screen.FontCount & vbCrLf & _
"Number of Printer Fonts = " & Printer.FontCount)
End Sub
I just wanted to point that out
Dan PM
Analyst Programmer
VB6 SP3 (also VB4 16-bit sometimes  )
-
Apr 29th, 2000, 10:51 AM
#4
Conquistador
this way is also simple:
Code:
For i = 0 To Screen.FontCount - 1
List1.AddItem Screen.Fonts(i)
Next
good luck 
-
Apr 29th, 2000, 11:30 PM
#5
Member
Do not forget to set the the "Sorted" property of your Combo box to true

keetsh
-
Apr 30th, 2000, 02:38 PM
#6
Conquistador
-
Apr 30th, 2000, 04:51 PM
#7
Member
Hummm yes that is actually the primary meaning of 'sorted' 
See you,
keetsh®
-
May 1st, 2000, 05:46 PM
#8
Conquistador
Originally posted by keetsh
Hummm yes that is actually the primary meaning of 'sorted' 
See you,
keetsh®
yeah, sorry
-
May 1st, 2000, 06:00 PM
#9
Member
Hehey no prob da_silvy )
See you,
keetsh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|