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

# TTreeNode.DeleteChildren

Removes all child nodes and descendants in the tree structure.

## Declaration

Source position: comctrls.pp line 3139

`public procedure TTreeNode.DeleteChildren;`

## Description

DeleteChildren clears the node cache in the TTreeNodes owner prior to removing any child nodes in Items. It calls the Collapse method with recursion to set the child nodes and their descendent nodes to the collapsed state. The HasChildren property is set to False to update the States flag values in the node and cause the TreeView control to be redrawn.

## See also

TTreeNode.States |  | Contains active state flags for the tree node.
TTreeNode.Collapse |  | Collapses the current tree node, and optionally collapses any descendent nodes.
TTreeNode.HasChildren |  | Indicates whether the tree node has child nodes.