TreeView Xojo plugin

TreeView.BeforeNodeCollapsing Event

This event is fired when a node is about to collapse.

BeforeNodeCollapsing(
   node as TreeViewNode,
   nodeIndex as Integer)

Parameters

node
The node that is about to collapse.
nodeIndex
The screen index of the node that is about to collapse.

Remarks

Do not manipulate any nodes that are not children of the collapsing node from within this event.

If you want to delete all nodes under the collapsing node when collapsing then here is a example of that:

// Here we clean up and remove all nodes under the current node

// Note that we don't lock the drawing and we should not do so,
// the BeforeNodeCollapsing and BeforeNodeExpanded are in a protected
// drawing scope.

while node.NodeCount > 0
    me.RemoveNode(nodeIndex + 1)
wend


See also the Dynamic load example project that comes with the TreeView.

See Also

TreeView Control