我正在使用其他一些属性创建自己的表单。我已经为这个表单创建了一个构造函数,它试图使用继承的构造函数。我已经尝试了我的构造函数,无论是否有过载。无论哪种方式,当我实际尝试在运行时创建表单的实例时,我得到一个错误"资源TChronPanelForm未找到"。当我尝试调用继承的构造函数时发生错误。
type
TChronPanelForm = class(TForm)
public
MainBox:TScrollBox;
isLoaded: boolean;
constructor create(AOwner: TComponent); override; // have tried w/ and w/out override
// more may come here, but left it at this to make initial attempt simple
private
{}
end;
// here is my constructor
{ TChronPanelForm }
constructor TChronPanelForm.create(AOwner: TComponent);
begin
inherited Create(aOwner);
// the above line is where the error occurs
isLoaded := false;
...
end;
// And then at run time this creates an instance
// from within another class:
...
var
aForm: TChronPanelForm;
begin
aForm := TChronPanelForm.create(DockSite);
...
感谢您提供的任何澄清。感谢。