DLL窗体停靠后,窗体中的listview ,Memo 提示"no parent"错误的解决办法

来源:互联网 发布:量化交易数据 编辑:程序博客网 时间:2024/06/16 16:50

修改" 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  找不到,具体太详细原因,暂时理解不了。先贴出代码方便以后使用。



0 0
原创粉丝点击