’f是标致,有键盘或鼠标按下就为假
’60秒后如果f为真,说明没有按下,因此退出。
Option Explicit
Dim f As Boolean
Private Sub Form_Click()
f = False
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
f = False
End Sub
Private Sub Form_Load()
Timer1.Enable = True
Timer1.Interval = 1000
f = True
End Sub
Private Sub Timer1_Timer()
Static c As Integer
c = c + 1
If c >= 60 And f = True Then
End
End If
End Sub
简单一点的方法,用time控件检测mouse api