When working with the Virtual TreeView component the most optimized way of adding (or removing child nodes is by changing the ChildCount.

I often make the mistake of change the ChildCount of a Node using:

Node^.ChildCount := Count;

If you look into the source you will see why this will not work, the proper way is:

VirtualTree.ChildCount[Node] := Count;

This is mainly a note to self since I tend to forget it all the time ;-)

Related posts:

  1. VMWare Workstation and Virtual PC XP Mode: unrecoverable error