引用:
作者: chung1206
我改成這樣如下:
Private Sub Timer1_Timer()
Dim NowSecond As Long
NowSecond = (Date - StartDate) * 86400 + Timer
If NowSecond - StartSecond >= 120 Then
Call Command1_Click
Me.WindowState = 0
End If
StartDate = Date
StartSecond = Timer
End Sub
但仍然沒反應=.=
|
發現程式有矛盾
改成
語法:
Dim StartDate As Date
Dim StartSecond As Long
Private Sub Form_Load()
StartDate = Date
StartSecond = Timer
Timer1.Interval = 500
End Sub
Private Sub Timer1_Timer()
Dim NowSecond As Long
NowSecond = (Date - StartDate) * 86400 + Timer
If NowSecond - StartSecond >= 120 Then
' MsgBox "2分鐘了"
Me.WindowState = 0
StartDate = Date
StartSecond = Timer
End If
End Sub