I would like to go through ALL the roots of a VirtualTreeView and delete them.
I don't want to clear it.
I get an access violation with this code:
var
Node : PVirtualNode;
begin
if VirtualStringTree1.GetFirst = NIL then exit;
Node := NIL;
repeat
if Node = NIL then
Node := VirtualStringTree1.GetLast
else Node:=VirtualStringTree1.GetPrevious (Node);
if Node <> NIL then VirtualStringTree1.DeleteNode(Node);
until Node = VirtualStringTree1.GetFirst;
end;
Thank you for your help.