Results 1 to 4 of 4

Thread: TreeView - quick question

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    3
    Hi All,

    I have a quick question about TreeView control.

    Is it possible to expand all nodes in a treeview at runtime (once the tree is populated), without the user having to click on each parent node to expand the child nodes seperately? I've looked through the Books Online, MSDN and other help sources but can't find any information about this topic.

    Regards
    Delphy

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    You can enumarate the Nodes collection, and make sure each nodes expanded property is set to true.

    Code:
        Dim myNode As Node
        
        For Each myNode In TreeView1.Nodes
          myNode.Expanded = True
        Next
    Iain, thats with an i by the way!

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    3

    Thanks

    Ah-ha, thanks I knew it would probably be something simple like this.

    Cheers
    Delphy

  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Originally posted by delphy
    Hi All,

    I have a quick question about TreeView control.

    Is it possible to expand all nodes in a treeview at runtime (once the tree is populated), without the user having to click on each parent node to expand the child nodes seperately? I've looked through the Books Online, MSDN and other help sources but can't find any information about this topic.

    Regards
    Delphy
    As you're loading the tree, include the following

    node.EnsureVisible (I do it below the set statement)

    [Edited by JHausmann on 08-02-2000 at 11:12 AM]

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