System.Windows.Forms.TreeNode.Toggle Method

Toggles the tree node to either the expanded or collapsed state.

Syntax

public void Toggle ()

Remarks

The tree node is toggled to the state opposite its current state, either expanded or collapsed.

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