unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,StdCtrls{必须加上};
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
Myedit:array of tedit;//动态数组
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
i:integer;
begin
setlength(myedit,3); //动态设定myedit的元素个数
for i:=low(myedit) to high(myedit) do
begin
myedit:=tedit.create(self);
myedit.parent:=form1;
myedit.SetBounds(ALeft, ATop, AWidth, AHeight)//设定位置
end;
end;
end.
/*实际上,我是很菜的。还没有用过ado,有机会向你请教一下ADO和ACCESS
caffen前面那几句我不懂,不知谁能解释一下*/