Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List of Font Names & Sizes

Status
Not open for further replies.

Calen

Programmer
Sep 19, 2002
26
US
Hi,

I'm trying to load a Combo Box with a list of the Fonts on the users machine. And then when a Font is selected, I need to load another Combo Box with a list of Sizes that are appropriate to the selected Font.

Any and all help will be greatly appreciated,

Thanks in advance,

Calen
 
Try this

[tt]
Private Sub Form_Load()
Dim I As Double
For I = 0 To Screen.FontCount - 1
Combo1.AddItem Screen.Fonts(I)
Next I

End Sub
[/tt]

Good Luck
 
You could also use a commondialogbox:

CommonDialog1.ShowFont
to get your font choice Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Thanks a lot, vb5prgrmr, that gets me half way there!

Now how do I get a list of Font Sizes for the selected Font, or for each Font?

johnwm -- I must use Combo Boxes so I can't use the Common Dialog method, but thanks a lot just the same.


 

most fonts will support the sizes from 1 to 148 (if not more) but for the best bet you could use what you see displayed in MSWord for font sizes or 6,8,10,12,14,16,18,24,36,48,72 but checking to make sure that if system font is selected reducing the selection to 6,8,10,12.


Good Luck


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top