关于窗体Create方法重载的问题
我新建了一个窗体,这个窗体因为是继承于TForm,所以Create方法只有一个(AOwner: TComponent)参数,我希望在使用这个窗体的时候能够多传一个参数进去,所以我想是否可以重载这个Create方法,比如按照下列格式:
public
constructor Create(AOwner:TComponent,OpType:integer);override;
constructor TMyForm.Create(AOwner:TComponent,OpType:integer);
begin
inherited;
//Using Optype here
end;
不知道这样做有没有问题,但是编译不能通过阿,出现下列错误;
Error:Declartion of "Create" differs from preverious declartion
Error:Incompatible of types
Error:Undeclared identifier "OpType"
请问如果我要实现我的要求,该怎么做?