Alguien puede decirme porque si, en vez de utilizar el array de tabs ya creados, utilizo el sistema de crear los tabs cuando abro el form2 con el metodo:
Código:
procedure TForm1.Boton1Click;
var Form2:TForm2;
PaxNum:Integer;
Begin
with TTabSheet.Create(self) do
begin
PageControl:=PageControl1;
Name:='Pagina'+trim(inttostr(Contador));
Caption:='Sesiones';
PaxNum:=PageIndex;
end;
inc(Contador);
Form2:=TForm2.Create(Self);
with Form2 do
begin
Parent:=PageControl1.Pages[PaxNum];
Show;
end;
end;
me da error de desbordamiento de pila y sin embargo:
Código:
procedure Form1.Boton1Click;
var Form2:TForm2;
PaxNum:Integer;
Pax:TtabSheet;
Begin
with TTabSheet.Create(self) do
begin
PageControl:=PageControl1;
Name:='Pagina'+trim(inttostr(Contador));
Caption:='Sesiones';
PaxNum:=PageIndex;
Pax:=PageControl1.Pages[PaxNum];
end;
inc(Contador);
Form2:=TForm2.Create(Self);
with Form2 do
begin
Parent:=Pax;
Show;
end;
end;
funciona correctamente?