Add all fonts to a treeview control

This example will show you how to add all your system fonts to the treeview control.
'//Add a treeview control to your form
'//Paste this in your form 
Private sub form_load()
 Dim i As Integer
With TreeView1.Nodes

    Set Root = .Add(, , , "Available System Fonts")
    For i = 1 To Screen.FontCount - 1
       .Add Root.Index, tvwChild, , Screen.Fonts(i)
    Next
End With
end sub
In the above code, notice the "set Root". This line is the name of the Title or the Category, and anything below it is considered its "subtitles". For example: Title []- Subtitle []-Subtitle Tile 2 []-Subtitle []-Subtitle

You might also like...

Comments

 Robert age:14, programmer;languages(vb, c++,vbscript, html)

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' but 'That's funny...'” - Isaac Asimov