February 17, 2019
Hot Topics:

VB Coding Tip: Treeview - The Basics

  • November 17, 2002
  • By Sam Huggill
  • Send Email »
  • More Articles »

The basics of using the treeview control.

Private Sub Form_Load() 
'Declare Variables 
Dim mNode As Node 
Dim i As Integer 
'Populate the list box 
List1.AddItem "Node 1" 
List1.AddItem "Node 2" 
List1.AddItem "Node 3" 
'Add the primary node 
Set mNode = Treeview1.Nodes.Add() 
mNode.text = "Primary Node" 
'Add the nodes from the list box 
For i = 0 To List1.ListCount -1 
 Set mNode = Treeview1.Nodes.Add(1, tvwChild) 
 mNode.Text = List1.List(i) 
Next i 
End Sub

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date