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

# TTreeNodeExpandedState

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TTreeNodeExpandedState - class to store and restore the expanded state of a TTreeView. The nodes are identified by their Text property.

## Declaration

Source position: comctrls.pp line 2817

`type TTreeNodeExpandedState = class`
`NodeText: String;` |  | NodeText - the text in the current node
`Children: TAvgLvlTree;` |  | Children - the children of the current node, as an AvgLvlTree
`procedure Create();` |  | Create - constructor for the rest of the tree structure
`destructor Destroy; override;` |  |
`procedure Clear;` |  | Clear the nodes from the tree structure
`procedure CreateChildNodes();` |  | CreateChildNodes - constructor for the offspring nodes
`procedure Apply();` |  | Apply - continue reconstructing the tree structure by adding the remaining nodes in succession
`end;`

## Inheritance

`TTreeNodeExpandedState` |  | TTreeNodeExpandedState - class to store and restore the expanded state of a TTreeView. The nodes are identified by their Text property.
`TObject`

## Description

TTreeNodeExpandedState - class to store and restore the expanded state of a TTreeView. The nodes are identified by their Text property.

Usage example:

    // save old expanded state
          OldExpanded:=TTreeNodeExpandedState.Create(ATreeView);
          ... change a lot of nodes ...
          // restore old expanded state
          OldExpanded.Apply(ATreeView);
          OldExpanded.Free;

The latest version of this document can be found at lazarus-ccr.sourceforge.net .