begin
  probar1.Max:=adoquery2.RecordCount;
  probar1.Position:=0;
  while not adoquery2.eof do
  begin
    ............
    probar1.Position:=probar1.Position+1;
    adoquery2.next;  
  end;
end;
这样进度条怎么没有反应?怎么在进度条中显示进度的百分数。多谢!

解决方案 »

  1.   

    用samples下的TGauge控件进度条带百分数 
    adoquery2.first;
    while not adoquery2.eof do
      

  2.   

    依照你的写法 probar1.Position不就是条数
      

  3.   

    begin
      probar1.Max:=adoquery2.RecordCount;
      probar1.Position:=0;
      label.visable=true;
      label.caption='dfsdf';//********竟在界面上显示什么都没有,其实有是白色的,结束后才能看到?怎么回事啊?
      while not adoquery2.eof do
      begin
        ............
        probar1.Position:=probar1.Position+1;
        adoquery2.next;  
      end;
    end;
      

  4.   

    在你的循环体内写上
    Application.ProcessMessages 试下
      

  5.   

    begin
      probar1.Max:=adoquery2.RecordCount;
      probar1.Position:=0;
      while not adoquery2.eof do
      begin
        ............
        probar1.Position:=probar1.Position+1;
        adoquery2.next; 
        Application.ProcessMessages;///////////////////////此句很重要的  
      end;
    end;
      

  6.   

    如果要显示百分数,可以使用TGauge控件
    begin
      Gauge1.Maxvalue:=adoquery2.RecordCount;
      Gauge1.Progress:=1;
      while not adoquery2.eof do
      begin
        ............
        Gauge1.Progress := Gauge1.Progress+1;
        adoquery2.next; 
        Application.ProcessMessages;///////////////////////此句很重要的  
      end;
    end;
      

  7.   

    楼主为什么不用一下TGauge控件呢
    TGauge控件可显示进度百分数,用法和TProgressBar差不多
      

  8.   

    begin
      probar1.Max:=adoquery2.RecordCount;
      probar1.Position:=0;
      while not adoquery2.eof do
      begin
        Application.ProcessMessages;///////////////////////此句很重要的
        ............
        probar1.Position:=probar1.Position+1;
        adoquery2.next;  
      end;
    end;
      

  9.   

    各位老大,不好意思,是我的问题。我的probar1.Position没有改变,始终是0 所以不变。不好意思了。哈哈。还是多谢你们的帮助!