procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
ProgressBar1.Step := 20;
for i := 1 to 5 do
begin
sleep(500);
ProgressBar1.StepIt;
Update;
Label1.Caption := IntToStr(ProgressBar1.Position) + '%';
Update;
Application.ProcessMessages;
end;
end;
위와 같이 작성하고 실행해 보면 Label에 20%가 찍힐 때 프로그래스바는 0이고, Label이 40%되면 그 때서야 프로그래스바가 20이 됩니다.
프로그래스바가 1 스텝만큼 계속 느린데, 이유가 뭘까요? ㅠㅠ
|