//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "TreeViewToListBox.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: TreeViewToListBox
// Method: ComCtrls.TTreeNodes.GetFirstNode
// Method: ComCtrls.TTreeNode.GetNext

// BeginCode
/*
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.
*/
void __fastcall TForm1::FormCreate(TObject *Sender)
{
  TTreeNode *CurItem = TreeView1->Items->GetFirstNode();
  while (CurItem)
  {
	ListBox1->Items->Add(CurItem->Text);
	CurItem = CurItem->GetNext();
  }
// EndCode
// EndExample: TreeViewToListBox
}
//---------------------------------------------------------------------------
