TreeNodeNew

 

Create a node

 

object @TreeNodeNew(string text, int imageIndex, int selectedImageIndex);

 

Parameters

string text : Text in a node

int imageIndex : The number of the image to be displayed

int selectedImageIndex : The number of the image to display when selected.

 

Return Value

Returns the node that was created.

 

Example

@TreeViewNodeClear("TreeView1");

node = @TreeNodeNew("Floor1", 0, 0);
child = @TreeNodeNew("Office1", 1, 1);
@TreeNodeAdd(node, child);
child = @TreeNodeNew("Office2", 1, 1);
@TreeNodeAdd(node, child);
child = @TreeNodeNew("Office3", 1, 1);
@TreeNodeAdd(node, child);
@TreeViewNodeAdd("TreeView1", node);

node = @TreeNodeNew("Floor2", 0, 0);
child = @TreeNodeNew("Office4", 1, 1);
@TreeNodeAdd(node, child);
child = @TreeNodeNew("Office5", 1, 1);
@TreeNodeAdd(node, child);
child = @TreeNodeNew("Office6", 1, 1);
@TreeNodeAdd(node, child);
@TreeViewNodeAdd("TreeView1", node);

@TreeViewExpandAll("TreeView1");

 

Description : Add the Floor1 and Floor2 nodes to the TreeView1 object, and add Office1, Office2, Office3 and Office4, Office5, and Office6 as child nodes, respectively.

 

Version Information

Supported version: 10.3.3 or higher

 

Related Helps

@TreeNodeAdd()

@TreeNodeGetFullPath()

@TreeNodeGetText()

@TreeNodeNew()

@TreeViewExpandAll()

@TreeViewGetSelectedNode()

@TreeViewNodeAdd()

@TreeViewNodeClear()

@TreeViewSeekNode()

@TreeViewSetImageList()

@TreeViewSetSelectedNode()