Hi there,

I have a treeview withmany nodes within it, at many levels. I have
writen a function which collapses the list at a certain node level and
another function for expanding the list out fully. The problem is that
after I expand the list, the end (bottom section) of the expanded list
comes into view, resulting in the fact that sometimes the selected
node is not visable after expansion. I wish to adjust the view so that
the selected items appears at the top of the treeview's view (window).

How would you solve this?

Barry.

RE: Seeing the selected node after TreeView expansion by DK

DK
Fri Jun 01 15:04:00 CDT 2007

Did you try TreeNode.EnsureVisible method? It makes sure that the treenode is
visible by scrolling the treeview control.

http://msdn2.microsoft.com/en-us/library/system.windows.forms.treenode.ensurevisible.aspx

--
DKumar


"bg_ie@yahoo.com" wrote:

> Hi there,
>
> I have a treeview withmany nodes within it, at many levels. I have
> writen a function which collapses the list at a certain node level and
> another function for expanding the list out fully. The problem is that
> after I expand the list, the end (bottom section) of the expanded list
> comes into view, resulting in the fact that sometimes the selected
> node is not visable after expansion. I wish to adjust the view so that
> the selected items appears at the top of the treeview's view (window).
>
> How would you solve this?
>
> Barry.
>
>