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:
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