System.Windows.Forms.TreeNode.Collapse Method

Collapses the tree node.

Syntax

public void Collapse ()

Remarks

The TreeNode.Collapse method collapses the current System.Windows.Forms.TreeNode and its child nodes. If you want to collapse only the current System.Windows.Forms.TreeNode, use the TreeNode.Collapse(bool) overload, passing true to ignore its child nodes.

Note:

The state of a System.Windows.Forms.TreeNode is persisted. For example, if the next level of child nodes was not collapsed previously, when the TreeNode.Expand method is called, the child nodes appear in their previously expanded state.

Requirements

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