Ver Mensaje Individual
  #2  
Antiguo 31-10-2007
Avatar de xEsk
[xEsk] xEsk is offline
Miembro Premium
 
Registrado: feb 2006
Posts: 454
Reputación: 19
xEsk Va por buen camino
En lugar de programar todo esto en el "OnShow", es más recomendable (en este caso) crear un proceso tuyo, y desde ahí realizar las comprobaciones.

Que ganamos haciendo esto? Pues que si no queremos mostrar el formulario, no llamamos el "show" y ya tenemos el cancelar hecho.

Así pues, la cosa quedaría algo parecida a esto:

Lo llamas:
Código Delphi [-]
Application.CreateForm(TfDomingo_T, fDomingo_T);
fDomingo_T.mostrarFormulario;

y definir el procedure "mostrarFormulario":

Código Delphi [-]
Donde := MessageDlgPosI(' ¿Cena, Mensaje, Presidir u Otro?  ',mtInformation,[mbIgnore,
         mbRetry, mbAll, mbNoToAll, mbYesToAll],0,360,319,ltSpanish2);
 
 case Donde of
    8:
      begin  // 8: Es Presidir
       EsP := True ;
      end;
    4:
      begin  // 4: Es Cena
      EsC := True;
      end;
    5:
      begin  // Es Mensaje
       EsM := True;
      end;
    9:
      begin  // Es otro
       EsO := True;
      end;
    10:
      begin  // Es Cancelar
       EsCerrar := True;
       end;
 end; // case

// He ententado con esto, en la opción 'Cancelar' hacer 'EsCerrar = True' y...


if not EsCerrar then
 begin
   show;
 end;

Saludos.
Responder Con Cita