1
procedure Iterate(Node: TTreeNode);
begin
if Node = nil then
exit;
...do something you want
for i := 0 to Node.Count - 1do
Iterate(Node.Item);
end;
2
procedure Iterate2(Node: TTreeNode);
var
toplevel: ineteger;
begin
if Node = nil then
exit;
toplevel := Node.Level;
while (Node <> nil) and (Node.Level > toplevel)do
begin
...do something you want
Node := Node.GetNext;
end;
end;