VB6.0中如何实现按下COMMAND按钮不放3秒后,连续执行该命令按钮里代码!当放开按钮时,停止执行!
展开全部
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer1.Interval = 2000
Timer1.Enabled = True
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Timer1.Interval = 100
‘你要执行的代码
End Sub
Timer1.Interval = 2000
Timer1.Enabled = True
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Timer1.Interval = 100
‘你要执行的代码
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询