Ver Mensaje Individual
  #2  
Antiguo 18-09-2007
Avatar de gluglu
[gluglu] gluglu is offline
Miembro Premium
 
Registrado: sep 2004
Ubicación: Málaga - España
Posts: 1.455
Reputación: 23
gluglu Va por buen camino
... y por qué siquiera avisar de que lo tiene abierto ? Se muestra y ya está.

Código Delphi [-]
procedure Tincio.BitBtn1Click(Sender: TObject);
begin
  if not Assigned(FPedido) then FPedido := TFPedido.Create(self);
  FPedido.Show;
end;

... y en el caso de MDI o si se permite minizar el Form :

Código Delphi [-]
procedure Tincio.BitBtn1Click(Sender: TObject);
begin
  if not Assigned(FPedido) then FPedido := TFPedido.Create(self);
  FPedido.Show;
  if FPedido.WindowState = wsMinimized then
    FPedido.WindowState := wsNormal;
end;

Y edito y añado :

Como decía Neftalí, tienes que recordar poner la variable a nil en el OnClose de FPedido :
Código Delphi [-]
procedure TFPedido.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  Action := caFree;
  FPedido := nil;
end;
... o utilizar FreeAndNil.
__________________
Piensa siempre en positivo !

Última edición por gluglu fecha: 18-09-2007 a las 10:19:11.
Responder Con Cita