修改" C:\Program Files\Borland\CBuilder6\Source\vcl "目录下 forms.pas文件;
定位到GetParentForm函数位置。将函数内容修改为
function GetParentForm(Control: TControl): TCustomForm;
begin
while Control.Parent <> nil do Control := Control.Parent;
//if Control is TCustomForm then
// Result := TCustomForm(Control) else
// Result := nil;
if Control is TCustomForm then
Result := TCustomForm(Control)
else
begin
if upperCase(Control.ClassName) =upperCase(Control.ClassName) then
Result := TForm(Control)
else
Result := nil;
end;
end;
完成后将forms.pas加入本工程,然后重新完全编译才可以。
就可以,原因应该是由于继承的TCustomForm 找不到,具体太详细原因,暂时理解不了。先贴出代码方便以后使用。