1个回答
展开全部
添加text1
command1
Dim t As Integer
Private Sub Command1_Click()
Timer1.Interval = 1000
Timer1.Enabled = True
t = 120
End Sub
Private Sub Form_Load()
Text1.Text = "2:00"
End Sub
Private Sub Timer1_Timer()
t = t - 1
Text1.Text = CStr(t \ 60) & ":" & CStr(t Mod 60)
If t = 0 Then Timer1.Enabled = False
End Sub
更多追问追答
追问
如果用 Format函数这个怎么实现倒计时呢
就是02:00,01:59 ……
追答
Text1.Text = Format(CStr(t \ 60), "00") & ":" & Format(CStr(t Mod 60), "00")
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询