<p>How can I maintain the scroll position of a treeview control in .NET application? For example, I have a treeview control and go through a process of adding various nodes to it tacking them on to the bottom. During this process, I can scroll through the treeview and view different nodes. The problem is when the process completes, the treeview scrolls to the very bottom.</p>

<p>It appears that calling treenode.Expand() is what is throwing me off track here. When a parent node is expanded, it gets the focus.</p>

<p>Is there a way around this? If I'm looking at a specific node while the process is running, I don't want it to jump around on me when the process is done.</p>

I think I figured it out:
Get the node at the top of the treeview.
Expand the parent node.
Make the node that was previously at the top visible.
```
```
If treeNodeParent.IsExpanded = False Then
    Dim currentNode As TreeNode = TreeViewHosts.GetNodeAt(0, 0)
    treeNodeParent.Expand()
    currentNode.EnsureVisible()
End If
```
```
Is the a better way to do this?