Ver Mensaje Individual
  #2  
Antiguo 19-08-2021
cloayza cloayza is offline
Miembro
 
Registrado: may 2003
Ubicación: San Pedro de la Paz, Chile
Posts: 922
Reputación: 23
cloayza Tiene un aura espectacularcloayza Tiene un aura espectacular
Lo de tener varios TForm dentro de un TPageControl u otro Form es sencillo.

El wndForm principal tendrá un TPageControl

Código Delphi [-]

Procedure TwndForm.CreateForm(FormClass:TFormClass; AParent:TWinControl; AColor:TColor; AFont:TFont);
Begin
     With FormClass.Create(Application) Do
     Begin
          Color      := AColor;   {Color del Form}
          Font       := AFont;   {Fuente del Form}
          BorderIcons:= [];     {Form sin bordes}
          BorderStyle:= bsNone; {Bordes del Form si estilo}
          Align      := alClient; {Form alineado al cliente}
          Parent     := AParent; { Padre del Form}
     End;
End;

procedure TwndForm.PageControlOnChange(Sender:TObject)
begin
        {Si la página activa ya tiene un form creado no debe crear otro}
        if (PageControl.ActivePage.ControlCount<>0) then
           Exit;


       case PageControl.TabIndex of
          0:Begin 
                    CreateForm( TForm1, PageControl.ActivePage, Self.Color, Self.Font);

                    TForm1(PageControl.ActivePage.Controls[0]).Show;
            End;
          1:Begin 
                 CreateForm( TForm2, PageControl.ActivePage, Self.Color, Self.Font);

                 TForm2(PageControl.ActivePage.Controls[0]).Show;
            End;
       end;

end;

Espero te oriente en lo que deseas realizar.

Saludos cordiales
Responder Con Cita