想编写一个到了指定的时间会出来一个以话框提示的程序,不知道用什么函数

解决方案 »

  1.   

    用timer定时检测当前时间,当然可以提取,小时(HourOf),分钟(MinuteOf),记得uses DateUtils
      

  2.   

    procedure TAutoMail.TimerTimer(Sender: TObject);
    begin
      if FormatDateTime('HH:MM:SS', Now) = edtTime.Text then btnSend.Click;
    end;
      

  3.   

      
      procedure TForm1.Timer1Timer(Sender: TObject);
      var
      x:string;
      begin
      x :=formatdatetime('yyyy/m/d hh:mm:ss',now);
      if formatdatetime('yyyy/m/d hh:mm:ss',now)= '2010/10/12 16:07:00' then
      showmessage('已经'+x+'啦!');
      end;
      
      

  4.   

    用Timer定时检测当前时间,var
      TemDT: TDateTime;TemDT := StrToDateTime('2010-10-10 10:10:10');  //指定触发时间//Timer触发函数
    begin
      if CompareDateTime(Now, TemDT) >= 0 then
      begin
        //tmr1.Enabled := False;
        //do something
      end;
    end;