AddNode adds a node object to the collection. AddNode returns the newly-added node, and takes the following parameters. 函数AddNode增加一个node到TreeNodes, 返回新增的node, 需要以下的参数:
Node is the node object to be added. If Node is nil, then the tree view's CreateNode method is called to provide one. 参数Node是被增加的函数,如果Node是nil,TreeView会自动创建一个
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. 参数Relative和Method一起指定了新节点的位置,其中Relative(亲戚节点)是已经存在的节点,它将成为新节点的父节点或者兄弟节点;Method进一步确定新节点和Relative的关系,由类型为TNodeAttachMode的常数确定。
The S parameter specifies the Text property of the new node. 参数S指定新节点的Text属性
The Ptr parameter specifies the Data property value of the new node. 参数Ptr指定新节点的Data属性
function AddObject(Node: TTreeNode; const S: string; Ptr: Pointer): TTreeNode; function Add(Node: TTreeNode; const S: string): TTreeNode; 也可以的
用AddObject
DELPHI中有帮助
Description
描述:
AddNode adds a node object to the collection. AddNode returns the newly-added node, and takes the following parameters.
函数AddNode增加一个node到TreeNodes, 返回新增的node, 需要以下的参数:
Node is the node object to be added. If Node is nil, then the tree view's CreateNode method is called to provide one.
参数Node是被增加的函数,如果Node是nil,TreeView会自动创建一个
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.
参数Relative和Method一起指定了新节点的位置,其中Relative(亲戚节点)是已经存在的节点,它将成为新节点的父节点或者兄弟节点;Method进一步确定新节点和Relative的关系,由类型为TNodeAttachMode的常数确定。
The S parameter specifies the Text property of the new node.
参数S指定新节点的Text属性
The Ptr parameter specifies the Data property value of the new node.
参数Ptr指定新节点的Data属性
function Add(Node: TTreeNode; const S: string): TTreeNode;
也可以的