远行效果:

  利用uniGUI中的TUniPageControl实现多页面 随笔

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

 

 

实现代码:

procedure TfrmMain.OpenForm(Caption,FormClassName:string);
var
  i:integer;
  sheet:TUniTabSheet;
begin
  for i := 0 to pgeMain.PageCount-1  do
    begin
      if pgeMain.Pages[i].Caption=Caption then
         begin
         pgeMain.ActivePageIndex:=i;
         exit;
         end;
    end;


  sheet:=TUniTabSheet.Create(Self);
  sheet.Closable:=True;
  sheet.Caption:=Caption;
  sheet.PageIndex:=i+1;
  sheet.PageControl:=pgeMain;


  FCurrentFrame:=TUniFrameClass(FindClass(FormClassName)).Create(Self);


  FCurrentFrame.Align:=alClient;
  FCurrentFrame.Parent:=sheet;
  pgeMain.ActivePage:=sheet;


end;
---------------------
作者:liaobotao
来源:CSDN
原文:https://blog.csdn.net/liaobotao/article/details/7618737
版权声明:本文为博主原创文章,转载请附上博文链接!

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄