No quise publicar el código por que es comun encontrarlo en internet. igual lo comparto:
Código de Formulario Principal:
Código Delphi
[-]
sbMainTransaction: TStatusBar;
pbMain: TProgressBar;
tmrMain: TTimer;
.
procedure TForm.FormCreate(Sender: TObject);
begin
sbMainTransaction.Panels[6].Style := psOwnerDraw;
pbMain.Parent := sbMainTransaction;
pbMain.Position:= 0;
pbMain.Max:= 20000;
end;
procedure TForm.sbMainTransactionDrawPanel(StatusBar: TStatusBar;
Panel: TStatusPanel; const Rect: TRect);
begin
if Panel = StatusBar.Panels[6] then
with pbMain do begin
Top := Rect.Top;
Left := Rect.Left;
Width := Rect.Right - Rect.Left - 15;
Height := Rect.Bottom - Rect.Top;
end;
end;
procedure TForm.tmrMainTimer(Sender: TObject);
var
vIdleTime : Cardinal;
begin
vIdleTime := GetTickCount - TimerInicio;
pbMain.Position:= pbMain.Position + 1;
lblSeq.Caption:= IntToStr(pbMain.Position);
if(vIdleTime >= 20000) then
begin
ShowMessage('Tiempo límite');
Application.Terminate;
end;
end;
procedure TForm.FormShow(Sender: TObject);
begin
tmrMain.Enabled := True;
end;
Formulario Nuevo (Hereda de Form. Principal)
Código Delphi
[-]
procedure TFormNew.FormShow(Sender: TObject);
begin
inherited;
end;
PUSE UNA ETIQUETA (lblSeq) PARA VERIFICAR SI ESTA INCREMENTANDO LA POSICIÓN DEL PROGRESS Y SU ESTA INCREMENTANDO. LO QUE NO SE ESTA VISUALIZANDO EN EL FORMULARIO QUE HEREDA ES EL EFECTO DEL PROGRESS QUE PINTE LA BARRA EN BASE AL INCREMENTO.
QUE PODRÍA ESTAR FALTANDO?