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;
原文地址:http://www.cnblogs.com/hnxxcxg/p/3819877.html