Results 1 to 3 of 3

Thread: A collapse all for a treeview

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309

    Post

    I need a function that will collapse all for a given treeview

  2. #2
    Member
    Join Date
    Aug 1999
    Posts
    52

    Post

    hi,

    Try this 1..

    TreeView1.SelectedItem.Expanded = False

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

    kandan
    E-mail: [email protected]
    ICQ: 52774533

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309

    Post

    Yeah, I know...

    I could do something like this:

    Code:
    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width