Delphi中没有控件数组,不过你可以用以下方法解决:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
arraydbedit:array[0..15] of TDBEDIT;
pointer:array[0..15] of integer;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var d:integer;
begin
for d:=0 to 15 do
begin
arraydbedit[d]:=TDBEDIT.create(self);
with arraydbedit[d] do
begin
parent:=self;
caption:=inttostr(d);
top:=d*21;
end;
end;
end;