我想传一个FormID的参数进去,
于是在public中加上(从新变更了create方法)
constructor Create(AOwner: TComponent;FormID: Integer);reintroduce;overload;
该form是个父类,子类继承了,在实例化后,就是在该窗体show的时候(form1.show),报异常。
constructor TBasicAnlayFrm.Create(AOwner:TComponent;FormID: Integer);
begin
  ChildFormID := FormID;  //可正常运行
end;  //跳出debug的窗口,异常了

解决方案 »

  1.   

    给你段代码 不知道符合不符合你的要求
    constructor CreateLogin(Owner: TComponent;Flag:integer);//第二个参数为自己加入的标志参数constructor TfrmLogin.CreateLogin(Owner: TComponent;Flag:integer);
    begin
      inherited Create(Owner);
      FFlag:=Flag;
    end;调用
    frmLogin:=TFrmLogin.CreateLogin(Application,0);//此处第一个参数还可以为self,nil根据需要而定
      

  2.   

    constructor TForm2.Create(AOwner: TComponent; FormID: Integer);
    begin
      Inherited Create(AOwner);
      ChildFormID := FormID;  //タ盽?︽
    end;試下這樣
      

  3.   

    Inherited Create(AOwner);
    不过楼主...