给你个例子,至于数据库的管理对应如果有好办法告诉我一声(动态数据有点难)
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
{ Public declarations }
end;
var
Form1: TForm1;
SetEdit: Array[0..20] of TEdit;
SetLable: Array[0..20] of TLabel;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
begin
for i := 0 to 9 do
begin
SetEdit := TEdit.Create(self);
SetEdit.Parent := Self;
SetEdit.Top := 20;
SetEdit.Left := 20 + 50*i;
SetEdit.Height := 21;
SetEdit.Width := 30;
SetEdit.Visible := true;
SetLable := TLabel.Create(self);
SetLable.Parent := Self;
SetLable.Top := 60;
SetLable.Left := 20 + 50*i;
SetLable.Height := 21;
SetLable.Width := 30;
SetLable.Caption := 'lable';
SetLable.Visible := true;
end;
end;
end.