TreeView Xojo plugin

TreeView.IndexFromNode Method

Gets a screen index from a given node.

IndexFromNode(
   node as TreeViewNode) as Integer

Parameters

node
The node to find the index for.

Returns

Integer
The index of the node if found, -1 if it was not found. (Note that a node only has screen index if its within expanded scope)

Remarks

This function needs to loop the Nodes, using it should be avoided for performance reasons. But there are valid cases where using a function like this cannot be avoided.

Note
There is another variation of this function which can give better performance if the index of the parent node or a node above your node is known.

See Also

TreeView Control