Experts Exchange connects you with the people and services you need so you can get back to work.
Public Class Form1
Dim RemainingTime As TimeSpan
Dim remaining As Integer
Dim StartDate As Date
Dim EndDate As Date
Dim activatedAlready = False
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
StartDate = Date.Now
'EndDate = StartDate.AddMinutes(1)
EndDate = StartDate.AddDays(3)
Label12.Visible = False
Timer1.Interval = "1000"
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
RemainingTime = EndDate - Date.Now
remaining = RemainingTime.TotalSeconds
If remaining > 0 Then
Label3.Text = RemainingTime.Days
Label4.Text = RemainingTime.Hours
Label5.Text = RemainingTime.Minutes
Label8.Text = RemainingTime.Seconds
Label12.Visible = True
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.