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

#include <vcl.h>
#pragma hdrstop

#include "TTreeSelected.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: TTreeSelected
// Property: ComCtrls.TCustomTreeView.Selected
// Property: ComCtrls.TListItems.Item

// BeginCode
/*
The following code uses Item to add the labels of all child
nodes of the selected node to a list box when a button is
clicked.  This example requires a button, a listbox, and a
populated treeview.
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  for (int i = 0; i < TreeView1->Selected->Count; i++)
	ListBox1->Items->Add(TreeView1->Selected->Item[i]->Text);
}
// EndCode
// EndExample: TTreeSelected
//---------------------------------------------------------------------------
