Timer1.Interval=30000 Timer1.Enable =True ... Private Sub Timer1_Timer() if Format(Now,"hh:mm")="10:50" or Format(Now,"hh:mm")="10:57" then MsgBox Format(Now,"hh:mm") end if End Sub
Timer1.Interval=30000 Timer1.Enable =True ... Private Sub Timer1_Timer() dim i as integer for i=0 to 23 if hour(Now)=i and Minute(now)=i then'00:00 01:01 02:02 ... 23:23 MsgBox Format(Now,"hh:mm") end if next End Sub
Timer1.Interval=30000 Timer1.Enable =True ... Private Sub Timer1_Timer() if Minute(now)=int(rnd*60) then '随机00..59 MsgBox Format(Now,"hh:mm") end if End Sub
Timer1.Enable =True
...
Private Sub Timer1_Timer()
if Format(Now,"hh:mm")="10:50" or Format(Now,"hh:mm")="10:57" then
MsgBox Format(Now,"hh:mm")
end if
End Sub
请问随机的那么又是如何实现呢?本人较笨较死板~
Timer1.Enable =True
...
Private Sub Timer1_Timer()
dim i as integer
for i=0 to 23
if hour(Now)=i and Minute(now)=i then'00:00 01:01 02:02 ... 23:23
MsgBox Format(Now,"hh:mm")
end if
next
End Sub
Timer1.Enable =True
...
Private Sub Timer1_Timer()
if Minute(now)=int(rnd*60) then '随机00..59
MsgBox Format(Now,"hh:mm")
end if
End Sub