Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / ActiveX Controls / July 2005

Tip: Looking for answers? Try searching our database.

TreeView, expand all in code?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SteveInBeloit - 07 Jul 2005 22:35 GMT
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
Ron Weiner - 07 Jul 2005 23:22 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.