I have a form with a MS Treeview Ctl 6 on it. All works fine. I would like
for it to be completely expanded with the user sees it, I don't want them to
have to click each '+' sign to expand each node.
Is there a setting when I add each one, or some code I can loop through to
set it?
Thanks,
Steve
From a button on the form containing the tree view control
Private Sub cmdTreeExpandAll_Click()
' Purpose Expand all nodes in the Tree
Dim i As Integer
If tvw.Nodes.Count > 0 Then
For i = 1 To tvw.Nodes.Count
tvw.Nodes(i).Expanded = True
Next
tvw.Nodes(1).EnsureVisible ' Select the First Node in the
tree
tvw.Nodes(1).Selected = True
tvw.SetFocus
End If
End Sub
Private Sub cmdTreeCollapseAll_Click()
' Purpose Collapse all nodes in the Tree
Dim i As Integer
If tvw.Nodes.Count > 0 Then
For i = 1 To tvw.Nodes.Count
tvw.Nodes(i).Expanded = False
Next
tvw.Nodes(1).EnsureVisible ' Select the First Node in the
tree
tvw.Nodes(1).Selected = True
tvw.SetFocus
End If
End Sub
Ron W
> I have a form with a MS Treeview Ctl 6 on it. All works fine. I would like
> for it to be completely expanded with the user sees it, I don't want them to
[quoted text clipped - 4 lines]
> Thanks,
> Steve
SteveInBeloit - 08 Jul 2005 17:02 GMT
Ron,
Thank you. Works great.
Steve
> From a button on the form containing the tree view control
>
[quoted text clipped - 38 lines]
> > Thanks,
> > Steve