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

#include <vcl.h>
#pragma hdrstop

#include "FindComponent.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: FindComponent
// Method: Classes.TComponent.FindComponent

// BeginCode
/*
The following example creates 20 edit boxes, using
FindComponent with the edit box name to access each newly
created edit box.
*/
const int EditBoxCount = 20;
const int LeftCoordinate = 10;
TEdit* pe[20];
void __fastcall TForm1::FormCreate(TObject *Sender)
{
	const char* pszNamePrefix = "MyEdit";
    for (int i=0;i<EditBoxCount;i++)
    {
		pe[i] = new TEdit(this); // These objects will be cleaned up by their owner (this).
        pe[i]->Name = pszNamePrefix + IntToStr(i+1);
        pe[i]->Left = LeftCoordinate;
        pe[i]->Top = i*EditBoxCount;
        pe[i]->Parent = this;
    }
}
// EndCode
// EndExample: FindComponent
//---------------------------------------------------------------------------
