Jump to content

Create TUniForm in TabSheet


billyChou

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...