How to create a countdown whit days, hours, minutes ect.

Hi all,
I want to create a countdown like this:
If the vbnet app starts the countdown started whit the value is today date + 3day
How can i mak this happen?
thanks fopr any replay
Fábián SomaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
What KIND of VB.Net application are you creating here?...Console, WinForms, WPF, WebForms, something else?...

What have you done so far?  What other kinds of time periods are you going to use?  How does the user enter them?  etc...
0
David Johnson, CD, MVPOwnerCommented:
DesignForm1.vb
Imports System.Threading
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"
        Timer1.Start()

    End Sub

    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
        Else
            Timer1.Stop()
            Label12.Visible = True
        End If

    End Sub
End Class

Open in new window

Solution
2017-11-12_5-14-11.mp4
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
No response from author.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.