to dreamfan(★★★★★)怎么判断呢?
就是调用那个产生子窗体的按钮的触发事件,对吧
具体调用那个方法阿?

解决方案 »

  1.   

    重载 TFrmInf的构造函数:Constructor Create(B:TButton); overload;
    .
    .
    .
    .
    constructor TFrmInf.Create(B:TButton);
    begin
      inherited;
      //以下根据B的属性指定 BBtn_Ent的Action属性
      ..........
    end;
      

  2.   

    子窗体中增加一个public过程setEvent(nmode:integer);
    在父窗体中点击不同BUTTON时穿给不同的数值如1、2;
    子窗体根据传入值执行不同的操作,此处为设置事件。
    父窗体中
    button1点击事件
    form2.setevent(1);
    form2.show
      

  3.   

    to  bigysw(大花脸) 
    好像不行阿,你实践过了么?
    提示好多错误:[Warning] Unit2.pas(20): Method 'Create' hides virtual method of base type 'TCustomForm'
    [Error] Unit2.pas(31): Undeclared identifier: 'create'
    [Error] Unit2.pas(33): This form of method call only allowed in methods of derived types
    [Error] Unit2.pas(34): Operator not applicable to this operand type
    [Error] Unit2.pas(35): Undeclared identifier: 'BBtn'
    [Error] Unit2.pas(35): Undeclared identifier: 'ActionList1'
    [Error] Unit2.pas(35): Missing operator or semicolon
    [Error] Unit2.pas(36): Operator not applicable to this operand type
    [Error] Unit2.pas(37): Missing operator or semicolon
    [Error] Unit2.pas(37): Missing operator or semicolon
    [Error] Unit2.pas(20): Unsatisfied forward or external declaration: 'TForm2.Create'
    [Fatal Error] Unit1.pas(78): Could not compile used unit 'Unit2.pas'
      

  4.   

    to zhxfzhxf1(zhxfzhxf1)
    请问:procedure SetEvent(mode:integer);
    怎么写?
      

  5.   

    有点错误。重载构造函数,如下,调试过的,当然你还得找你自己的改一下Constructor Create(B:TButton);
    .
    .
    .
    .
    constructor TFrmInf.Create(B:TButton);
    begin
      inherited Create(Nil);
      //以下根据B的属性指定 BBtn_Ent的Action属性
      ..........
    end;
      

  6.   

    to bigysw(大花脸)

    其实用Public就OK了。
    我用了个公用Proc,然后给父窗体调用。
    子窗体处理具体业务逻辑。谢谢各位了
    //the end