Lo puse de esta forma :
Código Delphi
[-]
case ventana_actual of
1: begin
NewBoton := TLabel.create(nil);
Parent := FPrincipal.GroupBoxProd1;
end;
2: begin
NewBoton := TLabel.create(nil);
Parent := FPrincipal.GroupBoxProd2;
end;
3: begin
NewBoton := TLabel.create(nil);
Parent := FPrincipal.GroupBoxProd3;
end;
4: begin
NewBoton := TLabel.create(nil);
Parent := FPrincipal.GroupBoxProd4;
end;
end;
with NewBoton do
begin
scontador:= IntToStr (contador);
nombre:= 'Boton';
Name := nombre+scontador;
Color:= clMoneyGreen;
Width := ancho_boton;
Height := alto_boton;
Left := margen_izq;
Autosize := false;
Top := margen_sup;
Caption := varCaption;
if soyingrediente <>1 then
OnClick := mostrar_productos
else
OnClick := mostrar_productos;
margen_izq_ant := margen_izq;
margen_sup_ant := margen_sup;
end;
Y al correr el ejecutable, manda una mensaje de error:
stack overflow
Y desaparece ese mensaje enseguida y no se abre el programa.
¿Sabes porque es esto?