billyChou Posted October 26, 2012 Share Posted October 26, 2012 hi all how to Create TUniForm in TabSheet. private { Private declarations } FCurrentFrame:TUniFrame; FCurrentForm:TUniForm; procedure TMainForm.OpenForm(Caption,FormClassName:string); var i:integer; sheet:TUniTabSheet; myForm : TuniForm; 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; FCurrentForm:= TUniFormClass(FindClass(FormClassName)).Create(Self); // error , Can't find FormClassName, and Can't Create Self // FCurrentForm:= TUniForm(FindClass(FormClassName)).Create(Self); FCurrentForm.Align:=alClient; FCurrentForm.Parent:=sheet; pgeMain.ActivePage:=sheet; end; procedure TMainForm.N15Click(Sender: TObject); begin // myFrm010.WindowState := wsMaximized; // myFrm010.ShowModal; OpenForm('Factory Base','Tfrm_myFrm010'); end; Thanks Quote Link to comment Share on other sites More sharing options...
alasoft Posted October 26, 2012 Share Posted October 26, 2012 hi all how to Create TUniForm in TabSheet. private { Private declarations } FCurrentFrame:TUniFrame; FCurrentForm:TUniForm; procedure TMainForm.OpenForm(Caption,FormClassName:string); var i:integer; sheet:TUniTabSheet; myForm : TuniForm; 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; FCurrentForm:= TUniFormClass(FindClass(FormClassName)).Create(Self); // error , Can't find FormClassName, and Can't Create Self // FCurrentForm:= TUniForm(FindClass(FormClassName)).Create(Self); FCurrentForm.Align:=alClient; FCurrentForm.Parent:=sheet; pgeMain.ActivePage:=sheet; end; procedure TMainForm.N15Click(Sender: TObject); begin // myFrm010.WindowState := wsMaximized; // myFrm010.ShowModal; OpenForm('Factory Base','Tfrm_myFrm010'); end; Thanks I have tried that before .. I couldn't .. so I use TUniFrame inside TUniTabSheet. Rober Quote Link to comment Share on other sites More sharing options...
billyChou Posted October 27, 2012 Author Share Posted October 27, 2012 I have tried that before .. I couldn't .. so I use TUniFrame inside TUniTabSheet. Rober Thanks billy Chou. Quote Link to comment Share on other sites More sharing options...
ogaere Posted March 30, 2013 Share Posted March 30, 2013 To embed a form into a TUniTabsheet, TUniframe is the only option Ebikekeme Ere Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.