我想编写一个延时减数的程序!但是只能运行一次!求解答
下面的就是我写的内容,但是我运行只能执行一次。我想任意数值减到0求解答Private Sub Form_Load()
Timer1.Interval = 2000
Timer1.Enabled = False
End Sub
Private Sub text1_keydown(keycode As Integer, shift As Integer)
If keycode = 13 Then Timer1.Enabled = True
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii <> 8 And KeyAscii < Asc(0) Or KeyAscii > Asc(9) Then KeyAscii = 0
'KeyAscii跟Del左右上下等无关,跟中文和特殊符号也有关。
End Sub
Private Sub Timer1_Timer()
If Val(Text1.Text) = 0 Then
Timer1.Enabled = False
Else
Text2.Text = Val(Text1.Text) - 1
End If
End Sub
[ 本帖最后由 pkby007 于 2011-7-5 22:01 编辑 ]