VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Counter Time

by Peter (2 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 4th November 2008
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Counter Time

Rate Counter Time



intbatas = 5
Me.Timer1.Interval = 1000
Me.Timer1.Enabled = True
End Sub

Private Sub Command2_Click()
intbatas = 5
Dim inttout As Integer
Dim dtm As Date
dtm = DateAdd("s", intbatas, Now)

Do Until Now >= dtm
DoEvents
inttout = Second(dtm) - Second(Now)
Me.Caption = "TimeOut:" & inttout
Loop
Unload Me
End Sub

Private Sub Timer1_Timer()
intbatas = intbatas - 1
If intbatas <= 0 Then
Me.Timer1.Enabled = False
Unload Me
Else
Me.Caption = "TimeOut:" & intbatas
End If
End Sub

Download this snippet    Add to My Saved Code

Counter Time Comments

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

Post your comment

Subject:
Message:
0/1000 characters