procedure TForm1.Button3Click(Sender: TObject);var i: Integer;
s: string;
begin
Memo1.Clear;
for i := 0 to TreeView1.Items.Count - 1do
begin
s := StringOfChar(#32, TreeView1.Items.Level * 4);
s := s + TreeView1.Items.Text;
Memo1.Lines.Add(s);
end;
end;