У меня проблема с отображением процесса хода длительных операций, помогите разобраться:
На Panel2 есть Animate1 (CommonAVI=aviCopyFiles), ProgressBar1, Gauge1, Timer1. При нажатии Button1:
Код:
procedure TForm1.Button1Click(Sender: TObject);
begin
Panel2.Visible:=True;
Animate1.Active:=True;
Timer1.Enabled:=True;
CopyFile(PAnsiChar(ExistFile),PAnsiChar(NewFile),False);
Animate1.Active:=False;
Timer1.Enabled:=False;
Panel2.Visible:=False;
end;
В событии таймера:
Код:
procedure TForm1.Timer1Event(Sender: TObject);
begin
Timer1.Enabled:=False;
ProgressBar1.StepIt;
if ProgressBar1.Position = ProgressBar1.Max then ProgressBar1.Position:=0;
Gauge1.Progress:=Gauge1.Progress+1;
if Gauge1.Progress = Gauge1.MaxValue then Gauge1.Progress:=0;
Timer1.Enabled:=True;
end;
При опробовании (без CopyFile) всё работает отлично. С CopyFile при копировании файла Animate1 зависает, ProgressBar1 стоит на месте, а Gauge1 вообще не видно! Пробовал в Timer1Event() перед Timer1.Enabled:=True добавить Panel2.UpdateControlState - ничего нового. Зараннее всем спасибо.
MAD: «code» tag.