一个简单的窗口,是一个倒计时程序,但后面那部分总是说我不合法出错,请各位朋友指点,先谢谢了。Dim m As LongPrivate Sub Command1_Click()
Text1 = Val(Text1) * 60
Timer1.Enabled = True
Label1.Caption = "开始倒计时"
Command1.Visible = False
End SubPrivate Sub Timer1_Timer()
m = Val(Text1)
m = m - 1
If m < 0 Then
Timer1.Enabled = False
MsgBox "时间到!", 0, "倒计时"
Label1.Caption = "请输入倒计时的分钟数"
Text1 = ""
Command1.Visible = True
Exit Sub
End If
n1 = Format(m Mod 60, "00")
n2 = Format((m Mod 60) Mod 60, "00:")
n3 = Format(m Mod 3600, "00:")
Text1=n3&n2&n1
Command1.Visible = False
End Sub
Text1 = Val(Text1) * 60
Timer1.Enabled = True
Label1.Caption = "开始倒计时"
Command1.Visible = False
End SubPrivate Sub Timer1_Timer()
m = Val(Text1)
m = m - 1
If m < 0 Then
Timer1.Enabled = False
MsgBox "时间到!", 0, "倒计时"
Label1.Caption = "请输入倒计时的分钟数"
Text1 = ""
Command1.Visible = True
Exit Sub
End If
n1 = Format(m Mod 60, "00")
n2 = Format((m Mod 60) Mod 60, "00:")
n3 = Format(m Mod 3600, "00:")
Text1=n3&n2&n1
Command1.Visible = False
End Sub
Dim m As Long
Dim n1 As String, n2 As String, n3 As StringPrivate Sub Command1_Click()
Text1 = Val(Text1) * 60
Timer1.Enabled = True
Label1.Caption = "¿ªÊ¼µ¹¼Æʱ"
Command1.Visible = False
End SubPrivate Sub Timer1_Timer()
m = Val(Text1)
m = m - 1
If m < 0 Then
Timer1.Enabled = False
MsgBox "ʱ¼äµ½£¡", 0, "µ¹¼Æʱ"
Label1.Caption = "ÇëÊäÈëµ¹¼ÆʱµÄ·ÖÖÓÊý"
Text1 = ""
Command1.Visible = True
Exit Sub
End If
n1 = Format(m Mod 60, "00")
n2 = Format((m Mod 60) Mod 60, "00:")
n3 = Format(m Mod 3600, "00:")
Text1 = n3 & n2 & n1
Command1.Visible = False
End Sub
Text1 = Val(Text1) * 60
Timer1.Enabled = True
Label1.Caption = "开始倒计时"
Command1.Visible = False
End SubPrivate Sub Timer1_Timer()
Dim n1 As String, n2 As String, n3 As String
m = Val(Text1)
m = m - 1
If m < 0 Then
Timer1.Enabled = False
MsgBox "时间到!", 0, "倒计时"
Label1.Caption = "请输入倒计时的分钟数"
Text1 = ""
Command1.Visible = True
Exit Sub
End If
n1 = Format(m Mod 60, "00")
n2 = Format((m Mod 60) Mod 60, "00:")
n3 = Format(m Mod 3600, "00:")
Text1 = n3 & n2 & n1
Command1.Visible = False
End Sub