Ver Mensaje Individual
  #16  
Antiguo 28-07-2006
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Reputación: 28
Lepe Va por buen camino
Código Delphi [-]
  Application.ProcessMessages;
  if not ExisteFrm(Frminformacion) then
    frminformacion := tfrminformacion.Create('Buscando Facturas de Importe menor a: 2 € :P',
                                                             '',
                                                             oShowProgress,
                                                             query1.RecordCount);
try
  //  Lo que debe hacer esta rutina.. un bucle y poco más
  Frminformacion.Info(objFactura.NFactura); //actualizo un label 
  Frminformacion.StepIt; // actualiza el ProgressBar en una posición
finally
    FreeAndNil(Frminformacion);
end;

Y la forma frmInformacion:
Código Delphi [-]
constructor TFrminformacion.Create(const Titulo: String; const informacion: String;
      const Opciones: TOptions = []; const MaxProgressValue:Integer = 100);
begin

  inherited Create(NIL);
  lblTitulo.Caption      := Titulo;
  lblinformacion.Caption := informacion;

  pnlCancel.Visible   := (oShowCancel in Opciones);
  pnlProgress.Visible := (oShowProgress in Opciones);
  Progessbar1.Max   :=MaxProgressValue;
  Self.AutoSize       := True;

  Show;
  Update;
end;

La forma no es Modal, porque entonces el programa se queda esperando en esta ventana, y el código que debe ejecutarse ¡¡no se ejecuta!!

La ventana FrmInformacion tiene el estilo fsStayOnTop, y la ventana que queda por detrás, suelo inhabilitarla (FormX.Enabled := false)

Creo que ahora si se entiende mucho mejor.

Saludos
__________________
Si usted entendió mi comentario, contácteme y gustosamente,
se lo volveré a explicar hasta que no lo entienda, Gracias.
Responder Con Cita