我在程序中用了一个进度条,如何和我的数据进度同步显示,
有这方面的例子没?请指教

解决方案 »

  1.   

    用adotable或adoquery的executeoptions属性下的eoasyncfetch和eoasyncfetchnone改为true
    再在它们的onfetchprogress事件中写ProgressBar1.position:=ProgressBar1.position+1;
      

  2.   

    progressbar1.position:=0;
    progressbar1.Max:=10000;//总时间
    progressbar1.min:=0;
    progressbar1.step:=1;//每步移动时间
    for i:=1 to 10000 do
      begin
        dialy;//调用延时过程
        函数控制每步的滚动时间。
      end;
    Close;//结束程序运行
      

  3.   

    先用recordcount得到数据的总数,然手用这个处理的条数除以总数就是progressbar的position了
    如果处理的数据太多的话就要用一个单独的线程做,不然的话就看不到动态增长的效果了
      

  4.   

    Gauge1.Visible := True;
    Gauge1.MaxValue:=ADO_Goods.FieldByName(count).AsInteger;//记录
    Gauge1.AddProgress(1); //写在记录
    Gauge1.Hide;//最后
      

  5.   

    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;