VB运行后30秒鼠标键盘无操作自动关闭

怎样让VB程序运行后30秒鼠标键盘无操作自动关闭介绍详细点啊,详细操作说明。我菜鸟啊!!!!谢谢大虾们!... 怎样让VB程序运行后30秒鼠标键盘无操作自动关闭
介绍详细点啊,详细操作说明。我菜鸟啊!!!!谢谢大虾们!
展开
 我来答
DP0031
2008-01-13 · 超过18用户采纳过TA的回答
知道答主
回答量:83
采纳率:0%
帮助的人:55.5万
展开全部
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Timer1.Enabled = False
End Sub

Private Sub Form_Load()
Timer1.Interval = 1000
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
Static s
s = s + 1
t = 30 - s
If t = 0 Then
Timer2.Enabled = False
MsgBox "时间到,退出", vbCritical, "error"
End
End If
End Sub
qiouyulei
2008-01-10 · 超过31用户采纳过TA的回答
知道答主
回答量:120
采纳率:0%
帮助的人:0
展开全部
Private flag As Boolean
Private a As Integer

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
flag = True
End Sub

Private Sub Form_Load()
Timer1.Interval = 1000
flag = False
Form1.KeyPreview = True
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
flag = True
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
flag = True
End Sub

Private Sub Timer1_Timer()
If flag = False Then
a = a + 1
If a >= 30 Then End
Else
a = 0
flag = False
End If
End Sub
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
我是观众26
2008-01-09 · 超过10用户采纳过TA的回答
知道答主
回答量:54
采纳率:0%
帮助的人:40.7万
展开全部
Dim sj As Date
Dim sj1 As Date
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
sj = Now()
End Sub
Private Sub Form_Load()
Form1.KeyPreview = True
Timer1.Interval = 1000
sj = Now()
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
sj = Now()
End Sub
Private Sub Timer1_Timer()
sj1 = Now()
a = DateDiff("s", sj, sj1)
If a > 30 Then
end
End If
End Sub
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
sihai163
2008-01-09 · TA获得超过160个赞
知道小有建树答主
回答量:469
采纳率:0%
帮助的人:376万
展开全部
你想干什么?做坏事?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(2)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式