如何用Timer,在某一固定的时间做某事如在中午12:00提醒该下班了
procedure TForm1.Timer1Timer(Sender: TObject);
begin
 {
}
showmessage('');
end;

解决方案 »

  1.   

    proceudre tform1.timer1timer(sender:tobject);
    begin
     if timetostr(now())='12:00:00'then
      begin
        //do something;
      end;
    end;
      

  2.   

    begin
    if timetostr(now())='12:00:00' then
    begin
      showmessage '到下班的时间了!'
    end;end;
      

  3.   

    procedure TForm1.Timer1Timer(Sender: TObject);
    begin
       if (Time() >= StrToTime("12:00:00")) and (Time() < StrToTime("12:01:00")) then
       begin
         ShowMessage('下班了。');
         Timer1.Enabled = false;
       end;
    end;
      

  4.   

    proceudre tform1.timer1timer(sender:tobject);
    begin
     if timetostr(now())='12:00:00'then
      begin
        //do something;
      end;
    end;
      

  5.   

    timer1的Interval属性怎么设置?