Article ID: 172286
Article Last Modified on 1/20/2007
TreeView Control
----------------
Name: tvcExample
Width: 2
Height: 2
Command Button
----------------------
Name: btnFillTreeView
Caption: Fill TreeView
Width: 1"
Height: .25"
Private Sub btnFillTreeView_Click()
Dim nodX As Node ' Declare Node variable.
With Me!tvcExample
' Set Treeview control properties.
.LineStyle = tvwRootLines ' Linestyle 1
' Add Node objects
' First node with 'Root1' as text.
Set nodX = .Nodes.Add(, , "r1", "Root1")
' Second node on root with 'Root2' as text
Set nodX = .Nodes.Add(, , "r2", "Root2")
' This next node is a child of Node 1 ("Root").
Set nodX = .Nodes.Add("r1", tvwChild, "child1", "Child")
End With
End Sub
Command Button
-----------------------
Name: btnDeleteAllNodes
Caption: Clear TreeView
Width: .25"
Height: 1"
Private Sub btnDeleteAllNodes_Click()
Me!tvcExample.Nodes.Clear
End Sub
Additional query words: basic delete
Keywords: kbhowto kbprogramming KB172286