加一个Timer控件,将其Interval设为1000 在Timer控件中写上如下代码: label1=time 得到小时:Hour(Now),分钟Minute(Now),秒Second(Now) 将这三个数值一比较就可以得到你要的了 if h=7 and m=30 then ppp
'定时执行某程序 '放一个timer控件 '在timer1_timer事件中获得当前时间 Now 'timer时间间隔设置为1秒钟 '如果是指定时间则运行你的程序Private Sub Form_Load() Timer1.Interval = 1000 Timer1.Enabled = True End SubPrivate Sub Timer1_Timer() Dim aa As Date aa = CDate("2003-12-11 17:20:39") If DateDiff("n", Now, aa) = 0 Then Shell "你的程序" End If
在Timer控件中写上如下代码:
label1=time
得到小时:Hour(Now),分钟Minute(Now),秒Second(Now)
将这三个数值一比较就可以得到你要的了
if h=7 and m=30 then ppp
'放一个timer控件
'在timer1_timer事件中获得当前时间 Now
'timer时间间隔设置为1秒钟
'如果是指定时间则运行你的程序Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End SubPrivate Sub Timer1_Timer()
Dim aa As Date
aa = CDate("2003-12-11 17:20:39")
If DateDiff("n", Now, aa) = 0 Then
Shell "你的程序"
End If
End Sub
怎样将timer时间间隔设置得尽量长一点,比如1分钟!
怎样将timer时间间隔设置得尽量长一点,比如1分钟!
dim lngHour as long
dim lngMinute as long
lngHour=Hour(now)
lngMinute=minute(now) if lngHour=7 and lngMinute=30 then
Shell "你的程序"
End If
End Sub
timer.interval=1000要设置在一分钟,
timer.interval=10000是不是很搞笑?