如标题

解决方案 »

  1.   

    unit Unit1;interfaceuses
     Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
     Dialogs, StdCtrls;type
     TForm1 = class(TForm)
       Button1: TButton;
       procedure Button1Click(Sender: TObject);
     private
       { Private declarations }
     public
       procedure buttonClick(sender:TObject);
       { Public declarations }
     end;var
     Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    var button:TButton;
    begin
      button:=Tbutton.create(self);
      button.Parent:=self;
      button.Caption:=datetostr(now);
      button.OnClick:=buttonClick;
    //自己给个循环就可以了
    end;procedure TForm1.buttonClick(sender:TObject);
    begin
       //按钮名称这样取:
       showmessage(TButton(sender).Caption);
       if TButton(sender).Name='buttonname' then
           begin
               //执行你要的代码!
           end;
    end;
      

  2.   

    delphi好像不支持设计期的控件数组。
      

  3.   

    将按扭按一定顺序放在一个panel上,然后运行时就可以用
    panel.Component[i]检索到相应的按扭了
    这算不算是数组了?
      

  4.   

    sorry 理解错了 ,delphi 不提供控件数组   VB里有.  delphi   只能一个个的复制张贴