TreeNode.Collapse Method (Boolean)

 

Collapses the TreeNode and optionally collapses its children.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public void Collapse(
	bool ignoreChildren
)

Parameters

ignoreChildren
Type: System.Boolean

true to leave the child nodes in their current state; false to collapse the child nodes.

Use the Collapse method, passing true, when you want to collapse a node but leave its child nodes in their expanded state.

.NET Framework
Available since 2.0
Return to top
Show: