How to do it: what - progressbar, on pressing the button, worked without stopping and after the end of the cycle - fill the progress bar at 100% and stop. ?
In the code:
Min and Max are properties responsible for a range of values.
Position - the position at which the indicator is currently located.
i is a variable for iterating over integers.
Label indicates which number is currently being processed.
procedure TForm1.Button1Click(Sender: TObject); var i, proc, Max : integer; begin Max := 50000; for i:=0 to Max do begin proc := ((i * 100) div Max); Label1.Caption := IntToStr(i); ProgressBar1.Position := proc ; Application.ProcessMessages; // Тут нужный цикл ........................................................ ......................................................... // И после окончания цикла - заполнить прогресс бар на 100% и остановить. end; end; That is, in simple words, saying - Make an "endless" progress bar, which simply shows that the download process is going on and stop it after the end of the cycle.
proc := 0;inside aninc(proc); ProgressBar1.Position := proc ;loopinc(proc); ProgressBar1.Position := proc ;inc(proc); ProgressBar1.Position := proc ;You can also add zeroingif (proc = 100) then poc = 0;- JVicif (i div 100) then обновить барevery hundred iterationsif (i div 100) then обновить бар- JVic