How To Get All The Installed Fonts - VB#10 ~ VBTheory™ Tutorials

Monday, April 16, 2012

How To Get All The Installed Fonts - VB#10


Code:

Imports System.Drawing.Text

In your button click event:
Dim installed_fonts As New InstalledFontCollection
Dim font_families() As FontFamily = installed_fonts.Families()
For Each font_family As FontFamily In font_families
  Listbox1.Items.Add(font_family.name)
Next font_family

In your listbox indexchanged event:
TextBox1.Font=New Font(Listbox1.Text, 8.25)



Share