unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TArrayEdit = array of tedit;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
n_edit : integer;
end;
var
Form1: TForm1;
tcreatedit : tarrayedit;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
begin
setlength(tcreatedit,n_edit);
for i := low(tcreatedit) to high(tcreatedit) do
begin
tcreatedit := tedit.Create(self);
tcreatedit.Parent := self;
tcreatedit.SetBounds(30*i,30*i,50*i,50*i);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
n_edit := 3;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
tcreatedit := nil;
end;
end.