VB怎么倒计时?
答案:1 悬赏:0 手机版
解决时间 2021-04-05 07:26
- 提问者网友:几叶到寒
- 2021-04-04 20:28
VB怎么倒计时?
最佳答案
- 五星知识达人网友:狂恋
- 2021-04-04 21:03
Dim a As Integer
Private Sub Form_Load()
a = 20
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
a = a - 1
Me.Caption = a
If a = 9 Then
Label1.Caption = "A"
ElseIf a = 7 Then
Label1.Caption = "B"
ElseIf a = 2 Then
Label1.Caption = "C"
End If
If a = 0 Then Timer1.Enabled = False: a = 20
End Sub
Private Sub Form_Load()
a = 20
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
a = a - 1
Me.Caption = a
If a = 9 Then
Label1.Caption = "A"
ElseIf a = 7 Then
Label1.Caption = "B"
ElseIf a = 2 Then
Label1.Caption = "C"
End If
If a = 0 Then Timer1.Enabled = False: a = 20
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯