TreeView_AddNode()

Examples


The TreeView_AddNode() function adds a new child node to the specified node in a tree view field.

Syntax

TreeView_AddNode(tree_view_field, label, data, parent_node_ID {, contains_children} {, unselected_image} {, selected_image} {, state_image})

Parameters

tree_view_field – The tree view field to which a new node will be added.

label – A string specifying the label to use for the new node.

data – A long integer specifying the data value to associate with the node.

parent_node_ID – A long integer specifying the ID of the parent node to which a new child node will be added. If you are adding a new node at the root level, use the constant TV_ROOT.

contains_children – An optional boolean indicating whether the new node is expected to contain children. If the new node will contain children, specify true. Otherwise, specify false. Specifying true causes the node to display the expansion button, even though the node has no children. This is useful when child nodes are added dynamically as a node is expanded. If this parameter is not supplied, it is assumed the new node won’t contain children.

unselected_image – An optional integer specifying the picture to display when the node is not selected. The value corresponds to the item number of an item listed in the TreeView Images window.

selected_image – An optional integer specifying the picture to display for the node when it is selected. Like the unselected_image parameter, this value corresponds to an item in the TreeView Images window.

state_image – An optional integer specifying the state image to display with the node. The value corresponds to the item number of a state image listed in the TreeView Images window.

Return value

A long integer containing the ID of the new node.


Documentation Feedback