System.Windows.Forms.TreeNode.EnsureVisible Method

Ensures that the tree node is visible, expanding tree nodes and scrolling the tree view control as necessary.

Syntax

public void EnsureVisible ()

Remarks

When the TreeNode.EnsureVisible method is called, the tree is expanded and scrolled to ensure that the current tree node is visible in the System.Windows.Forms.TreeView. This method is useful if you are selecting a tree node in code based on certain criteria. By calling this method after you select the node, the user can see and interact with the selected node.

Note:

If the TreeView.ItemHeight property is set to a value that is larger than the height of the tree view control, calling this method has unexpected results.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0