TreeViewToListBox (C++)

From RAD Studio Code Examples
Jump to: navigation, search

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