PDA

Click to See Complete Forum and Search --> : A collapse all for a treeview


Inhumanoid
Nov 23rd, 1999, 03:49 PM
I need a function that will collapse all for a given treeview

kandan
Nov 23rd, 1999, 04:55 PM
hi,

Try this 1..

TreeView1.SelectedItem.Expanded = False

note: this is only collapse the node which is selected..

kandan
E-mail: rg_kandan@usa.net
ICQ: 52774533

Inhumanoid
Nov 23rd, 1999, 05:17 PM
Yeah, I know...

I could do something like this:



Private Function collapse_all()
Dim i As Integer
For i = 1 To tvwTree.Nodes.Count
tvwTree.Nodes(i).Expanded = False
Next
End Function



But this also tries to collapse Nodes wich don't have children and it also tries to collapse nodes wich are allready collapsed...
At least that's what I think...