TreeNode.Collapse Method (Boolean)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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


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