to pipi:完整代码太长了,
Tparent=class(TGraphicControl)
....
constructor create(AOwner:TComponent;outputCanvas:TCanvas);virtual;
....
end;
Tchild=class(TParent)
....
constructor create(AOwner:TComponent;outputCanvas:TCanvas);override;
....
end;
implementation
constructor Tparent.create(AOwner:TComponent;outputCanvas:TCanvas);
begin
inherited create(AOwner);
....
end;
constructor Tchild.create(AOwner:TComponent;outputCanvas:TCanvas);
begin
inherited create(AOwner,outputCanvas);
....
end;
然后我在外面创建TChild的实例,
发现执行child=TChild.create(self,Canvas);语句只调用
Tparent类的create方法.