远行效果:
实现代码:
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;