http://www.csdn.net/expert/topic/226/226635.shtm

解决方案 »

  1.   

    createbutton.onclick:=procedurename;再写个过程procedurename就可以了
      

  2.   

    复制一个按钮的Click过程,将它改成你希望的名字(如:MyClick)
    MyButton.OnClick:=MyClick(假设拟创建的按钮名为MyButton
    它的属性、方法、事件都类似。
      

  3.   

    先写一个过程,然后
    vbutton.vonclick := procedurename;
      

  4.   

    noall的够清楚了,还不了事。
      

  5.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        Button2: TButton;
        procedure BtnClick(Sender: TObject);
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    begin
      Button2 := TButton.Create(Self);
      with Button2 do begin
        Parent := Self;
        Caption := 'Button2';
        OnClick := BtnClick;
      end;
    end;procedure TForm1.BtnClick(Sender: TObject);
    begin
      ShowMessage('This is Button2 Event.');
    end;
    end.
      

  6.   

    procedure 所传的参数一定要相同?如何我需要不同该怎么做?