Hi,
I need to know how cani programmatically expand or collapse a treeview.
Thanks in advance
Printable View
Hi,
I need to know how cani programmatically expand or collapse a treeview.
Thanks in advance
TreeView1.Nodes("NodeKey").Expanded = true
' or
Treeview1.Nodes(3).Expanded = true
You can not expand the entire treeview with one statement. You must expand individual nodes
John G
'Just addidtion to the John's answer - how to switch between expand/collapse
private Sub Command1_Click()
With TreeView1
.Nodes.Add , , "aaa", "aaa"
.Nodes.Add "aaa", tvwChild, "bbb", "bbb"
.Nodes("aaa").Expanded = true
End With
End Sub
private Sub Command2_Click()
TreeView1.Nodes("aaa").Expanded = Not TreeView1.Nodes("aaa").Expanded
End Sub
Iouri Boutchkine
[email protected]