Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Explicit
Dim datStart As Date
Dim datStop As Date
Private Const intSeconds As Integer = 10
Private Sub Form_Load()
Label1.Caption = intSeconds
With Timer1
.Enabled = False
.Interval = 1000
End With
End Sub
Private Sub Command1_Click()
Command1.Enabled = False
datStart = Now
datStop = DateAdd("s", intSeconds, Now)
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If datStart < datStop Then
datStart = DateAdd("s", 1, datStart)
Label1.Caption = DateDiff("s", datStart, datStop)
Else
MsgBox "I am DONE."
Timer1.Enabled = False
End If
End Sub
[blue]Option Explicit
Private Sub Form_Load()
With Timer1
.Enabled = False
.Interval = 1000
End With
End Sub
Private Sub Command1_Click()
Label1.Caption = 10 ' 10 secs
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Label1.Caption - 1
Timer1.Enabled = Label1.Caption <> "0"
End Sub[/blue]
[blue]Option Explicit
Private Sub Form_Load()
With Timer1
.Enabled = False
.Interval = 1000
End With
End Sub
Private Sub Command1_Click()
Label1.Tag = 10 * 60 ' 10 mins
Label1.Caption = Format(DateAdd("s", Label1.Tag, "00:00:00"), "nn:ss")
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
Label1.Tag = Label1.Tag - 1
Label1.Caption = Format(DateAdd("s", Label1.Tag, "00:00:00"), "nn:ss")
Timer1.Enabled = Label1.Tag <> "0"
End Sub[/blue]
count down to zero when it would [blue]activate a msg box[/blue]
Private Sub Timer1_Timer()
Label1.Tag = Label1.Tag - 1
Label1.Caption = Format(DateAdd("s", Label1.Tag, "00:00:00"), "nn:ss")
Timer1.Enabled = Label1.Tag <> "0"[blue]
If Not Timer1.Enabled Then
MsgBox "I am Done."
End If[/blue]
End Sub