Pete below is code I used to Expand and collapse a treview control where the
tree is left on the first node when done.
Private Sub cmdCollapse_Cli ck()
' Purpose Collapse all nodes in the Tree
Dim i As Integer
If tvwGoalBank.Nod es.Count > 0 Then
DoCmd.Hourglass True
For i = 1 To tvwGoalBank.Nod es.Count
tvwGoalBank.Nod es(i).Expanded = False
Next
DoCmd.Hourglass False
tvwGoalBank.Nod es(1).EnsureVis ible
tvwGoalBank.Nod es(1).Selected = True
tvwGoalBank.Set Focus
End If
End Sub
Private Sub cmdExpand_Click ()
' Purpose Expand all nodes in the Tree
Dim i As Integer
If tvwGoalBank.Nod es.Count > 0 Then
DoCmd.Hourglass True
For i = 1 To tvwGoalBank.Nod es.Count
tvwGoalBank.Nod es(i).Expanded = True
Next
DoCmd.Hourglass False
tvwGoalBank.Nod es(1).EnsureVis ible
tvwGoalBank.Nod es(1).Selected = True
tvwGoalBank.Set Focus
End If
End Sub
Ron W
"Larry Daugherty" <La************ ********@verizo n.net> wrote in message
news:IV******** ******@nwrddc03 .gnilink.net...
Hi Pete,
I plugged in another newsgroup where you're likely to get an answer from
Alex Dybenko. He's all over that Treeview stuff.
HTH
--
-Larry-
--
"PeteCressw ell" <Go**********@F atBelly.com> wrote in message
news:74******** *************** ***@posting.goo gle.com... I wrote some code to let the user toggle between all expanded and all
collapsed, but it tends to leave the view of the tree where I'd rather
not have it.
Can't find anything via Google...
Anybody know how to force the view of the tree to a certain node...or
at least to the top?