Hola
Aparte de lo dicho por el Maestro dec, que ademas no se me hubiera ocurrido (esta genial).
Este codigo lo encontre por ahi, crea un progressBar en un dialog.
Código Delphi
[-]
procedure TForm1.DialogTimer(Sender: TObject);
var
aPB : TProgressBar;
begin
if NOT (Sender is TTimer) then
Exit;
if ((Sender as TTimer).Owner) is TForm then
with ((Sender as TTimer).Owner) as TForm do
begin
aPB := TProgressBar(FindComponent('Progress'));
if aPB.Position >= aPB.Max then
ModalResult := mrCancel
else
aPB.StepIt;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
AMsgDialog : TForm;
AProgressBar : TProgressBar;
ATimer : TTimer;
begin
AMsgDialog := CreateMessageDialog('El Reporte esta por ejecutarse, Espere',
mtWarning, []) ;
AProgressBar := TProgressBar.Create(AMsgDialog) ;
ATimer := TTimer.Create(AMsgDialog) ;
with AMsgDialog do
try
Tag := 15; Caption := 'Reportes';
Height := 100;
with AProgressBar do begin
Name := 'Progress';
Parent := AMsgDialog;
Max := AMsgDialog.Tag;
Step := 1;
Top := 50;
Left := 8;
Width := AMsgDialog.ClientWidth - 16;
end;
with ATimer do begin
Interval := 1000;
OnTimer:=DialogTimer;
end;
case ShowModal of
ID_CANCEL: end;
finally
ATimer.OnTimer := nil;
Free;
end;
end;
Ahora solo seria aplicarlo en tu codigo, supongo.
Saludos
Edito: no puedo arreglar el codigo con las etiquetas.