在做一个停车场控制系统,主界面中间是一个RzPageControl,有一个Tabsheet,为监控刷卡分页,其中显示监控画面,点击按钮“出入记录”时,会先判断RzPageControl中是否存在出入记录分页,没有就在RzPageControl中添加一个“出入记录”的分页
代码如下:
procedure TFrmMain.PageAddForm(aPage: TRzPageControl; aForm: TForm; TaFormClass: TClass; FormName: string);
begin
  try
    Application.CreateForm(TComponentClass(TaFormClass), aForm);
    aPage.UseDockManager := True;
    LBInterface.Log.WriteLog('3:' + IntToStr(aPage.PageCount) + FormName, 3);
    aForm.ManualDock(aPage, nil, alClient);// (aPage); //融合至pageControl,
    LBInterface.Log.WriteLog('4:' + IntToStr(aPage.PageCount) + FormName, 3);
    aForm.Caption := FormName;
    aForm.Position := poMainFormCenter;
    aForm.Visible := True;              //这个比用 show效果更好
    aPage.ActivePageindex := aPage.PageCount - 1;
    // TODO -Eternally: PageAddForm default body inserted
  except
    on E:Exception do
    begin
      LBInterface.Log.WriteLog('9:' + e.Message, 3);
    end;
  end;
end;
系统运行一段时间后点击“出入记录”,执行到aForm.ManualDock(aPage, nil, alClient)时无法添加分页,程序没有报错,有存错误日志9:Error saving device context,