Scroll scrollbar in TreeView to see selected node RRS feed

  • Question

  • I have a treeview which gets populated.  When it is finished populating I select a node up at the top of the treeview.  However, this does not adjust the scroll to the top of the screen so that the user can see the node that is selected.  How doe I do this?

    I tried:
    TreeView1.selectednode = TreeView1.Nodes(0).Nodes(0)

    But this did not work.


    Monday, November 2, 2009 5:20 PM

All replies

  • That code should work because it works on my side without using ensurevisible method. Sometimes the scrollbar will not scroll to the top but the selected node will be visible. You can change the text of selected node if you like.


    If that what you want, take it. If not, ignored it and no complain
    Tuesday, November 3, 2009 4:59 PM