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

# TTreeNode.Assign

Implements object persistence for the TTreeNode type.

## Declaration

Source position: comctrls.pp line 3135

`public procedure TTreeNode.Assign(`
`Source: TPersistent`
`); override;`

## Arguments

`Source` |  | Persistent object with properties copied in the method.

## Description

Assign is an overridden method in TTreeNode used to implement object persistence for the type. Assign ensures that property values in Source are copied to the current class instance when it is derived from TTreeNode. Properties copied from Source include:

- Text
- Data
- ImageIndex
- SelectedIndex
- OverlayIndex
- Height
- Focused
- Cut
- HasChildren

The node cache in the TTreeNodes owner is cleared prior to copying values from Source (when assigned).

If Source is not a TTreeNode instance, the inherited method is called to complete the assignment or raise an EConvertError exception if Source is unassigned.

## See also

TPersistent.Assign