VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



simple timer

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

simple timer

Rate simple timer



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 CommandButton4_Click()
End
End Sub



Private Sub CommandButton5_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

simple timer Comments

No comments have been posted about simple timer. Why not be the first to post a comment about simple timer.

Post your comment

Subject:
Message:
0/1000 characters