首页 > 代码库 > unigui多页签UI框架

unigui多页签UI框架

 

procedure TMainForm.openForm(Caption, FormClassName: string);
var
i: integer;
sheet: TUniTabSheet;
begin
for i := 0 to page.PageCount - 1 do
begin
if page.Pages[i].Caption = Caption then
begin
page.ActivePageIndex := i;
exit;
end;
end;
sheet := TUniTabSheet.Create(Self);
sheet.Closable := True;
sheet.Caption := Caption;
sheet.PageControl := page;
FCurrentFrame := TUniFrameClass(FindClass(FormClassName)).Create(Self);
FCurrentFrame.Align := alClient;
FCurrentFrame.Parent := sheet;
page.ActivePage := sheet;
end;