Your technology certification is waiting. Enroll in Cloud Class ®
Public Class Form1
Private targetDT As DateTime
Private WithEvents tmr As New Timer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
targetDT = DateTime.Now.AddMinutes(30)
tmr.Interval = 1000
Private Sub tmr_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmr.Tick
Dim ts As TimeSpan = targetDT.Subtract(DateTime.Now)
If ts.TotalMilliseconds <= 0 Then
Label1.Text = ts.Minutes & ":" & ts.Seconds.ToString.PadLeft(2, "0")
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.