2。先写好一个处理程序比如是buuton1.onclick,新建控件b,b.click= button1.onclick(sender)

解决方案 »

  1.   

    3.实际上就是动态生成控件,lineto即可。
      

  2.   

    1.要用com接口,不过那个接口我忘了,抱歉!!
      

  3.   

    //2,哈哈哈哈
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        Button2: TButton;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
      showmessage('aaa');
    end;procedure TForm1.Button2Click(Sender: TObject);
    var
      a : Tbutton;
    begin
      a := tbutton.Create(self);;
      a.Parent := Form1;
      a.Name := 'button3';
      a.OnClick := button1.OnClick;
    end;end.
      

  4.   

    动态生成控件,须定义:
    var bt1:tbutton;bt1:=tbutton.creat(self);
    bt1.paraent:=self;
    bt1.left:=...;
    bt2.left:=...;
    bt2.caption:='...';
    bt1.onclick:=myClick;
    最后退出时最好记得:
    bt1.free;
    其中...自己填写,myclick是你写的事件,最好写在这段前面,或者在TYPE中说明!
      

  5.   

    最好不要在运行时修改组件的NAME属性(BORLAND推荐),容易出问题!
      

  6.   

    to z_x_b(长弓落日金沙丘):[email protected],thanks a lot.
      

  7.   

    1、动态生成控件;
    2、不用DLL直接使用扑克组件;
    3、应用程序的自我删除;
    4、组件简单动画;
    5、暂停程序运行;
    6、MessageBox的一些使用技巧;
    7、一个经典魔术揭秘;
    关于动态拖动控件,暂时没有,以后再说!
    详情请看压缩包中的readme.txt!
    50分“卖”给你,要吗?
      

  8.   

    to z_x_b(长弓落日金沙丘)和szgunz(),这么好的东东,我也想要,
    卖给我不??????
      

  9.   

    Give Me ,Please! [email protected]
      

  10.   

    to to z_x_b(长弓落日金沙丘).thank u 4 your rsc! you'll earn more points.thank u.