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

# TCustomTreeView.CanCollapse

Returns True if a given TreeNode can be collapsed.

## Declaration

Source position: comctrls.pp line 3565

`protected function TCustomTreeView.CanCollapse(`
`Node: TTreeNode`
`):Boolean; virtual;`

## Arguments

`Node` |  | Tree node examined in the method.

## Function result

True if the specified node can be collapsed.

## Description

CanCollapse is a Boolean function used to determine if the tree node in Node can be collapsed. CanCollapse signals the OnCollapsing event handler (when assigned) to determine if the tree node can be collapsed.

The return value is updated in the event handler, and can be set to True when the node has child nodes and is currently expanded. The return value should be set to False if the node does not have any child nodes.

The return value is always True if the OnCollapsing event handler has not been assigned, or when the component is being freed.