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
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