procedure Tmain.Timer1Timer(Sender: TObject);
begin
application.MessageBox('你们好!','提示:',0);
end程序如上,每隔5秒会提示一下,所以会出很多次
在没有点“取消”或“确定”情况下能不能不出第二次提示,点了后再提示。。
怎么解决????

解决方案 »

  1.   

    show的时候disable timer,提示关闭的时候再enable timer
      

  2.   

    老兄, 结贴吧,穷死我了!
    procedure TForm1.Timer1Timer(Sender: TObject);
    begin
      if FindWindow(nil,'提示:') = 0  then
      application.MessageBox('你们好!','提示:',0);
    end;
      

  3.   

    不要用application, 直接
    if MessageBox(...) = IDOK then
    begin
      Timer1.Enabled := FALSE;
    end;
      

  4.   

    MessageBox函数是有返回值的,请看:
    Return ValuesThe return value is zero if there is not enough memory to create the message box.
    If the function succeeds, the return value is one of the following menu-item values returned by the dialog box: Value Meaning
    IDABORT Abort button was selected.
    IDCANCEL Cancel button was selected.
    IDIGNORE Ignore button was selected.
    IDNO No button was selected.
    IDOK OK button was selected.
    IDRETRY Retry button was selected.
    IDYES Yes button was selected.
      

  5.   

    不要用application, 直接
    if MessageBox(...) <> IDOK then
    begin
      Timer1.Enabled := FALSE;
    end;
      

  6.   

    到时候先让Timer停下来,当点击ok的时候在启动Timer不就可以了吗!
      

  7.   

    误会您的意识了,huojiehai(海天子) 是对的!听他的。
      

  8.   

    procedure TForm1.Timer1Timer(Sender: TObject);
    begin
      if FindWindow(nil,'提示:') = 0  then
      application.MessageBox('你们好!','提示:',0);
    end;
    你式一试巴
      

  9.   

    procedure Tmain.Timer1Timer(Sender: TObject);
    begin
       TTimer(Sender).Enabled := false;
       application.MessageBox('你们好!','提示:',0);
    end
      

  10.   

    不就是吗?大家都说了在提示是将Timer false掉,当点击了“确定”或“取消”后,在将Timer true就是了。
    这样如果出现一次后,你没点“确定”或“取消”那么就不会再出现了。
      

  11.   

    楼上的,是读:lin qi
    我爱中国,爱我中国,中国爱我
      

  12.   

    使用MessageBox的返回值比较好.爱中国支持一个.
      

  13.   

    procedure Tmain.Timer1Timer(Sender: TObject);
    begin
      Timer1.Enabled:=False;
    application.MessageBox('你们好!','提示:',0);
      Timer1.Enabled:=True;end