VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Timer that counts down from any number you wish

by John Tomson (9 Submissions)
Category: Miscellaneous
Compatability: VB.NET
Difficulty: Unknown Difficulty
Originally Published: Tue 15th November 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Timer that counts down from any number you wish

API Declarations


CommandButton called CommandButton1, CommandButton2, CommandButton3

Rate Timer that counts down from any number you wish



Private Sub CommandButton1_Click()
CommandButton1.Caption = "start timer"
l1 = sec
CommandButton1.Visible = False
GoSub sec1
sec1:
Dim PTime, start
    PTime = 1
    start = timer
    Do While timer < start + PTime
     
    DoEvents
    Loop
 sec = sec - 1
    GoSub sc
sc:
    
     If sec <= 0 Then
 sec = 0
 Beep
 MsgBox "timer stoped"
 Beep
 CommandButton1.Visible = True
 Else
  GoSub sec1
    End If
    
End Sub





Private Sub CommandButton3_Click()
End
End Sub



Private Sub CommandButton2_Click()
CommandButton1.Visible = True
CommandButton1.Caption = "restart timer"
t1.Hide

MsgBox "timer paused at " & sec & " seconds"
t1.Show
CommandButton1.Visible = True
CommandButton1.Caption = "restart timer"
End Sub

Download this snippet    Add to My Saved Code

Timer that counts down from any number you wish Comments

No comments have been posted about Timer that counts down from any number you wish. Why not be the first to post a comment about Timer that counts down from any number you wish.

Post your comment

Subject:
Message:
0/1000 characters