billyChou Posted October 26, 2012 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
alasoft Posted October 26, 2012 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
billyChou Posted October 27, 2012 Author Posted October 27, 2012 I have tried that before .. I couldn't .. so I use TUniFrame inside TUniTabSheet. Rober Thanks billy Chou. Quote
ogaere Posted March 30, 2013 Posted March 30, 2013 To embed a form into a TUniTabsheet, TUniframe is the only option Ebikekeme Ere Quote
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.