How To Get Installed Fonts In VB.NET

this is not something as i wrote before by the way its kinds of that , i am just using a listbox and a label in this tutorials , the listbox will show all the fonts installed on your computer and the label will show how many fonts you have installed , lets make it , create a new project and name it whatever you want and add a listbox from the toolbox and a label and make everything fits the form like mine
get installed fonts

now double click your form and add these code:

Imports System.Drawing.Text
Public Class Form1

    'Author : Mohamed Shimran
    'Blog : http://www.ultimateprogrammingtutorials.blogspot.com

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim fonts As New InstalledFontCollection
        For Each one As FontFamily In fonts.Families
            ListBox1.Items.Add(one.Name)
        Next
        Label1.Text = "Totally " & ListBox1.Items.Count & " fonts are installed."
    End Sub
End Class

now debug and see how many fonts you have installed

here is mine
preview of get installed fonts

2 comments

Dieses Tut Funktiooniert nicht das geht anders und zwar so!

'Author : hobbygrafix
'Blog : http://bg-twmb.blogspot.com/

VB.NET Code
Sub MainFormLoad(sender As Object, e As EventArgs)
ListBox1.DataSource = FontFamily.Families
ListBox1.DisplayMember = "Name"
Label1.Text = "Totally " & ListBox1.Items.Count & " fonts are installed."
End Sub

Viel Spaß mit dem Code Wünscht http://bg-twmb.blogspot.com/

Reply

Post a Comment

Note: Only a member of this blog may post a comment.