[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TTreeNodeExpandedState.Apply

Used to restore the expanded state for a node or tree view.

## Declaration

Source position: comctrls.pp line 3939

`public procedure TTreeNodeExpandedState.Apply(`
`FirstTreeNode: TTreeNode;`
`CollapseToo: Boolean = True`
`); procedure TTreeNodeExpandedState.Apply(`
`TreeView: TCustomTreeView;`
`CollapseToo: Boolean = True`
`);`

## Arguments

`FirstTreeNode` |  | Initial tree node examined in the method.
`CollapseToo` |  | Collapses previously expanded child nodes when True.

## Arguments

`TreeView` |  | Tree view with nodes examined in the method.
`CollapseToo` |  | Collapses previously expanded child nodes when True.

## Description

Apply is an overloaded procedure used to restore the expanded state for nodes in a tree structure. The overloaded variants allow either a specific tree node or the first node in the tree view to be used to reconstruct the tree structure.

CollapseToo indicates whether child tree nodes are collapsed (when True) or expanded.