TreeViewToListBox (Delphi)
Description
The following example adds the Text for all items in the tree view to the list box. This example requires a ListBox and a populated TreeView.
Code
procedure TForm1.FormCreate(Sender: TObject);
var
CurItem: TTreeNode;
begin
CurItem := TreeView1.Items.GetFirstNode;
while CurItem <> nil do
begin
ListBox1.Items.Add(CurItem.Text);
CurItem := CurItem.GetNext;
end;
end;
Uses
- Vcl.ComCtrls.TTreeNodes.GetFirstNode ( fr | de | ja )
- Vcl.ComCtrls.TTreeNode.GetNext ( fr | de | ja )