用vb做一个计时器,没有开始暂停,就是在运行窗口的时候自动计时,高赏金
2个回答
展开全部
窗体上添加一个标签和一个计时器。朋友。
Dim t%, h%, d%
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000
Label1.FontSize = 20
End Sub
Private Sub Timer1_Timer()
t = t + 1
s = t Mod 60
m = t \ 60
If m >= 60 Then t = 0: m = 0: h = h + 1
If h >= 24 Then h = 0: d = d + 1
Label1 = d & "天" & h & "时" & m & "分" & s & "秒"
End Sub
Dim t%, h%, d%
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000
Label1.FontSize = 20
End Sub
Private Sub Timer1_Timer()
t = t + 1
s = t Mod 60
m = t \ 60
If m >= 60 Then t = 0: m = 0: h = h + 1
If h >= 24 Then h = 0: d = d + 1
Label1 = d & "天" & h & "时" & m & "分" & s & "秒"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询