VB Coding Tip: Treeview - The Basics

Saturday Nov 16th 2002 by Sam Huggill
Share:

The basics of using the treeview control.

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
Share:
Home
Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved