• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

DELPHI时间触发事件!

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
 1 procedure TForm1.Timer2Timer(Sender: TObject);   
 2 //delphi 时间触发事件   
 3 var  
 4   S,D:TDateTime;   
 5   ActiveHH:string;//触发小时   
 6   ActiveMM:string;//触发分   
 7   ActiveSS:string;//触发秒   
 8 begin  
 9   s:=strtodatetime(FormatDateTime('hh:mm:ss',Now));//时间   
10   
11   ActiveHH :=Edit3.Text;//时   
12   ActiveMM :=Edit4.Text;//分   
13   ActiveSS :=Edit5.Text; //秒   
14   
15   
16   D:=strtodatetime(ActiveHH +':' + ActiveMM + ':' + ActiveSS); //到时间    
17   
18   //当日期为当天就触发   
19   if  FormatDateTime('YYYY-MM-DD ',DateTimePicker2.date) = FormatDateTime('YYYY-MM-DD ',now) then  
20   begin  
21     if s=then //当时间一样就触发   
22     begin  
23       showmessage('电脑爆了!');   
24       // 这中间你加入你自己要 执行的数据库语句   
25     end;   
26   end;   
27   
28 end;   

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
matlab_legend_使用发布时间:2022-07-18
下一篇:
matlab的legend()用法发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap