Vcl.ComCtrls.TTreeNodes.AddNode

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function AddNode(Node, Relative: TTreeNode; const S: string;  Ptr: TCustomData; Method: TNodeAttachMode): TTreeNode;

C++

TTreeNode* __fastcall AddNode(TTreeNode* Node, TTreeNode* Relative, const System::UnicodeString S, void * Ptr, TNodeAttachMode Method);

Properties

Type Visibility Source Unit Parent
function public
Vcl.ComCtrls.pas
Vcl.ComCtrls.hpp
Vcl.ComCtrls TTreeNodes

Description

Add a node to a tree view.

AddNode adds a node object to the collection. AddNode returns the newly-added node, and takes the following parameters.

Node is the node object to be added. If Node is nil, then the tree view's CreateNode method is called to provide one.

The Relative and Method parameters together define the location of the new node. Relative is an existing node that will be either parent or sibling to the new node. Method specifies the precise relationship between the new node and relative, as given by a TNodeAttachMode constant.

The S parameter specifies the Text property of the new node.

The Ptr parameter specifies the Data property value of the new node.

Note: The memory referenced by Ptr is not freed when the tree nodes object is freed.

See Also