vb记时器代码

2025-04-07 15:45:13
推荐回答(1个)
回答1:

Public a

Private Sub Form_KeyPress(KeyAscii As Integer)

If KeyAscii = 97 Then '按字母A时间+30秒
a = a + 30
End If
End Sub

Private Sub Form_Load()
Me.KeyPreview = True
Timer1.Interval = 1000
End Sub

Private Sub Timer1_Timer()
a = a + 1
Me.Cls
Print "系统记时" & a
End Sub