TreeViewToListBox (C++)
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
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
TTreeNode *CurItem = TreeView1->Items->GetFirstNode();
while (CurItem)
{
ListBox1->Items->Add(CurItem->Text);
CurItem = CurItem->GetNext();
}
Uses
- Vcl.ComCtrls.TTreeNodes.GetFirstNode ( fr | de | ja )
- Vcl.ComCtrls.TTreeNode.GetNext ( fr | de | ja )