progressbar1.position:=0; progressbar1.Max:=10000;//总时间 progressbar1.min:=0; progressbar1.step:=1;//每步移动时间 for i:=1 to 10000 do begin dialy;//调用延时过程 函数控制每步的滚动时间。 end; Close;//结束程序运行
var pro_step,id:Integer; recycle_length:Integerbegin pro_step:=progressbar1.Max Div recycle_length;//recycle_length=你所要执行程序的循环长度 For id:=1 To recycle_length Do Begin 你所要执行的循环程序; progressbar1.position:=progressbar1.position+pro_step; progressbar1.refresh; End; End;
再在它们的onfetchprogress事件中写ProgressBar1.position:=ProgressBar1.position+1;
progressbar1.Max:=10000;//总时间
progressbar1.min:=0;
progressbar1.step:=1;//每步移动时间
for i:=1 to 10000 do
begin
dialy;//调用延时过程
函数控制每步的滚动时间。
end;
Close;//结束程序运行
如果处理的数据太多的话就要用一个单独的线程做,不然的话就看不到动态增长的效果了
Gauge1.MaxValue:=ADO_Goods.FieldByName(count).AsInteger;//记录
Gauge1.AddProgress(1); //写在记录
Gauge1.Hide;//最后
recycle_length:Integerbegin pro_step:=progressbar1.Max Div recycle_length;//recycle_length=你所要执行程序的循环长度
For id:=1 To recycle_length Do
Begin
你所要执行的循环程序;
progressbar1.position:=progressbar1.position+pro_step;
progressbar1.refresh;
End;
End;