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

# TCustomShellTreeView.CreateNode

Creates a new tree node for the shell control.

## Declaration

Source position: shellctrls.pas line 106

`protected function TCustomShellTreeView.CreateNode: TTreeNode; override;`

## Function result

New tree node created in the method.

## Description

CreateNode is an overridden method used to create an new TTreeNode instance for the shell control. CreateNode calls the inherited method to create the class instance used as the return value for the method.

CreateNode ensures that the tree node is a TShellTreeNode class instance; the class type can be overridden in the OnCreateNodeClass event handler. If the new tree node is not derived from TShellTreeNode, an EShellCtrl exception is raised to indicate the invalid node type.

## Errors

Raises an EShellCtrl exception if the new tree node is not derived from TShellTreeNode.

## See also

TShellTreeNode |  | Represents tree nodes in TCustomShellTreeView / TShellTreeView.
EShellCtrl |  | Exception raised for errors occurring in shell controls.
TTreeNodeClass |  | Class type used to create new TTreeNode instances.
TCustomTreeView.OnCreateNodeClass |  | Event handler signalled to get the class reference used to create new tree nodes.