Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   OOP (https://www.clubdelphi.com/foros/forumdisplay.php?f=5)
-   -   PageControl me produce desbordamiento de pila (https://www.clubdelphi.com/foros/showthread.php?t=3905)

apicito 24-09-2003 12:35:09

PageControl me produce desbordamiento de pila
 
En tiempo de ejecución creo una pagina en un PageControl y dentro de ella abro un formulario, con este codigo:
Código:

procedure TPrincipal.Sesiones;
var Sesion:TSesion;
    PaxNum:Integer;
Begin
  with TTabSheet.Create(self) do
    begin
      PageControl:=Paxinas;
      Name:='Paxina'+trim(inttostr(Contador));
      Caption:='Sesiones';
      PaxNum:=PageIndex;
    end;
  inc(Contador);
  Sesion:=TSesion.Create(Self);
  with Sesion do
    begin
      Parent:=Paxinas.Pages[PaxNum];
      Show;
    end;
end;

Me da un error de desbordamiento de pila. Sin embargo si abro el formulario Sesión sin asignarle un parent no da problemas.
Que puede estar pasando?.

apicito 24-09-2003 17:07:55

Me auto respondo por si pudiera interesarle a alguien. Así funciona correctamente:
Código:

procedure TPrincipal.Sesiones;
var Sesion:TSesion;
    PaxNum:Integer;
    Pax:TtabSheet;
Begin
  with TTabSheet.Create(self) do
    begin
      PageControl:=Paxinas;
      Name:='Paxina'+trim(inttostr(Contador));
      Caption:='Sesiones';
      PaxNum:=PageIndex;
      Pax:=Paxinas.Pages[PaxNum];
    end;
  inc(Contador);
  Sesion:=TSesion.Create(Self);
  with Sesion do
    begin
      Parent:=Pax;
      Show;
    end;
end;

Que nadie me pregunte porqué... porque no lo sé.


La franja horaria es GMT +2. Ahora son las 06:09:44.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi