If at some point during the execution of your program, you need to make sure
that a node in the TreeView is visible, you can use
the EnsureVisible method of a specific node:
TreeView1.Nodes(23).EnsureVisible
This makes the node with an index of 23 visible to the user even if the node
is several levels deep in a tree that is completely collapsed. The
EnsureVisible property expands the tree to make the node visible.
To get the number of nodes visible at any one time, you can use the
GetVisibleCount method of the TreeView control.
By using
TreeView1.GetVisibleCount
you will get a count of nodes visible within the TreeView.
The count will only include those nodes that are visible, including any nodes
partially visible at the bottom of the control. The count does not include any
nodes expanded below the bottom edge of the TreeView
control.
Treeview Control topics