在特定时间获取时间事件 [英] Get time event at a specific time
问题描述
嗨!
是否有可能在特定时间举办时间活动,例如8点钟的时间?
?我的程序在后台运行,并且最小化到托盘栏。
如果没有,是否有一种平滑的方式以不同的方式实现这一点?
祝你好运,
Andreas Lundgren
" Andreas" < D9 **** @ efd.lth.se>在消息中写道
news:f7 ************************** @ posting.google.c om ...嗨!
是否有可能在特定时间举行时间活动,例如八点钟?我的程序在后台运行,并最小化到托盘栏。
如果没有,是否有一种顺利的方式以不同的方式完成此任务?
>最好的问候,
Andreas Lundgren
只需在表单上放置一个计时器控件,并将其设置为每秒触发一次。
您在代码中的某个位置设定了目标:
将目标定为日期
目标=" 10/4/2003 8:00 PM" ;
并在计时器代码中检查此目标:
私有子Timer1_Timer()
如果现在=>目标然后
''点燃你需要在目标时间发生的事件
结束如果
结束子
On Fri,2003年10月3日08:57:08 GMT,Raoul Watson
< Wa ***** @ IntelligenCIA.com>写道:
Andreas < D9 **** @ efd.lth.se>在消息中写道
新闻:f7 ************************** @ posting.google。 com ...嗨!
是否可以在特定时间获得时间事件,例如8点钟?我的程序在后台运行,并最小化到托盘栏。
如果没有,是否有一种顺利的方式以不同的方式完成此任务?
>最好的问候,
Andreas Lundgren
只需在表格上放置一个计时器控件,然后将其设置为每秒触发一次。
在代码中的某个位置设置目标:
昏暗目标为日期
目标=" 10/4/2003 8:00 PM"
嗯,这可能会在英国产生相当不同的结果在美国使用相同的
代码
就个人而言,我会使用DateSerial()和TimeSerial()来避免这样的问题
歧义
在计时器代码中检查此目标:
Private Sub Timer1_Timer()
如果Now =>目标然后
''点燃你需要在目标时间发生的事件
结束如果
结束子
可能最简单的方法是设置一个计时器事件(interval = 1000)
检查Time的值
Hi!
Is it possible to get a time event at a specific time, for instance
eight a''clock? My program is running in the background and is
minimized to the tray bar.
If not, is there a smooth way to accomplish this in a different way?
Best regards,
Andreas Lundgren解决方案
"Andreas" <d9****@efd.lth.se> wrote in message
news:f7**************************@posting.google.c om...Hi!
Is it possible to get a time event at a specific time, for instance
eight a''clock? My program is running in the background and is
minimized to the tray bar.
If not, is there a smooth way to accomplish this in a different way?
Best regards,
Andreas Lundgren
Just put a timer control on the form and set it to fire every second.
Somewhere in the code you set your target:
Dim Target As Date
Target = "10/4/2003 8:00 PM"
And in the timer code you check for this target:
Private Sub Timer1_Timer()
If Now => Target Then
'' fire the event that you need to happen at the target time
End If
End Sub
On Fri, 03 Oct 2003 08:57:08 GMT, "Raoul Watson"
<Wa*****@IntelligenCIA.com> wrote:
"Andreas" <d9****@efd.lth.se> wrote in message
news:f7**************************@posting.google. com...Hi!
Is it possible to get a time event at a specific time, for instance
eight a''clock? My program is running in the background and is
minimized to the tray bar.
If not, is there a smooth way to accomplish this in a different way?
Best regards,
Andreas Lundgren
Just put a timer control on the form and set it to fire every second.
Somewhere in the code you set your target:
Dim Target As Date
Target = "10/4/2003 8:00 PM"
Hmm, that could have rather different results in the UK to the same
code in the USA
Personally I would use DateSerial() and TimeSerial() to avoid such
ambiguity
And in the timer code you check for this target:
Private Sub Timer1_Timer()
If Now => Target Then
'' fire the event that you need to happen at the target time
End If
End Sub
Probably the simplest way is to set a timer event (interval=1000) that
checks the value of Time
这篇关于在特定时间获取时间事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!