Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If Val(Label1.Caption) > 0 Then
Label1.Caption = Label1.Caption - 1
Else
Timer1.Enabled = False
End If
End Sub
有个问题,程序本来是想按下后开始到计时的,可一调试就自动到计时了````我把哪给漏了?`` 作者: chinanic 时间: 2006-1-12 21:51 标题: [求助]VB编程
加入这一段:
Private Sub Form_load()
Timer1.Enabled=False
End Sub 作者: ouli 时间: 2006-1-12 23:27 标题: [求助]VB编程
如果是输入就立马开始倒计时:
Dim CNum As Integer ';定义模块级变量CNum
Private Sub Text1_Change()
CNum=Text1.text
Timer1.enabled=true
End Sub
Private Sub Timer1_Timer()
If Val(CNum) > 0 Then
Label1.Caption = CNum
Else
Timer1.Enabled = False
End If
If Val(Label1.Caption) > 0 Then
Label1.Caption = Label1.Caption - 1
Else
Timer1.Enabled = False
End If
End Sub