我动态创建的窗口比较慢,因为有很多条记录在那窗口里,如何在动态创建一个窗口时,先用进度条表示正在打开? 
等显示出来窗口时进度条也没了我想在下面的代码里加入先显示进度条的代码,如何加?
procedure TForm1.mxOutlookBarPro1Headers0Buttons0Click(Sender: TObject);
var
  fmP_archives:TfmP_archives;
begin
  dm1.ADOQuery4.Close;
  dm1.ADOQuery4.SQL.Clear;
  dm1.ADOQuery4.SQL.Add('select * from P_archives where isDimission=''否''');
  dm1.ADOQuery4.Open;  fmP_archives := TfmP_archives.Create(self);
  try
    fmP_archives.ShowModal;
  finally
    fmP_archives.Free;
  end;
end;

解决方案 »

  1.   

    在你的程序中大概的地方就加一下ProgressBar1.Position:=X;
      

  2.   

    procedure TForm1.mxOutlookBarPro1Headers0Buttons0Click(Sender: TObject);
    var
      fmP_archives:TfmP_archives;
    begin
      dm1.ADOQuery4.Close;
      dm1.ADOQuery4.SQL.Clear;
      dm1.ADOQuery4.SQL.Add('select * from P_archives where isDimission=''否''');
      dm1.ADOQuery4.Open;//-----------
      FormWait:=TFormWait.Creat(Self);
      FormWait.Show;
      FormWait.Update;
    //-----------  fmP_archives := TfmP_archives.Create(self);
      try
        fmP_archives.ShowModal;
      finally
        fmP_archives.Free;
      end;  //------------ 
      FormWait.Hide;
      FormFree.Free;
      //------------
    end;
      

  3.   

    我现在最主要想知道,怎么样去得知打开窗口的时间,这样好赋给进度条
    主要都是在你打开窗口中的大概位置formaa.ProgressBar1.Position:=X;
      

  4.   

    Sorder(剑客) 
    怎么创建一个线程?
      

  5.   

    procedure TForm1.Timer1Timer(Sender: TObject);
    begin
      progressbar1.position:=progressbar1.position+1;
      if progressbar1.Position =progressbar1.Max then
          timer1.enabled:=false;
    end;procedure TForm1.FormCreate(Sender: TObject);
    begin
      timer1.enabled:=true;end;
      

  6.   

    郁闷,我想到了,原来是
      dm1.ADOQuery4.Close;
      dm1.ADOQuery4.SQL.Clear;
      dm1.ADOQuery4.SQL.Add('select * from P_archives where isDimission=''否''');
      dm1.ADOQuery4.Open;
    这段代码.搜索数据库用的时间久,那我怎么知道完成dm1.ADOQuery4.Open
    用了多长时间?