title: How do I create a countdown timer using Hours, Minutes and Seconds?
body: <p>I was wondering how I would go about fixing my countdown timer so that it shows the time in Hours:Minutes:Seconds?</p>
  
  <p>currently, it only outputs the seconds and I'm not sure where I have gone wrong.<br>
  Any help is much appreciated. </p>
  
  <p>Code:  </p>
  
  <pre><code>Public Class Form1
      Dim TargetDT As DateTime
      Dim fields() As String
      Dim Days, Hours, minutes, seconds, milliseconds As String
  
      Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
          fields = Split(TextBox1.Text, ":")
          Hours = fields(0)
          minutes = fields(1)
          seconds = fields(2)
  
          Dim CountDownFrom As TimeSpan = TimeSpan.FromHours(Hours).FromMinutes(minutes).FromSeconds(seconds)
          Timer1.Interval = 1000
          TargetDT = DateTime.Now.Add(CountDownFrom)
          Timer1.Enabled = True
      End Sub
  
      Private Sub Timer1_Tick(sender As Object, e As System.EventArgs) Handles Timer1.Tick
          Dim ts As TimeSpan = TargetDT.Subtract(DateTime.Now)
          If ts.TotalMilliseconds &gt; 0 Then
              Con1Time.Text = ts.ToString("hh\:mm\:ss")
          Else
              Con1Time.Text = "0:00:00"
              Timer1.Stop()
              MessageBox.Show("Done")
          End If
      End Sub
  End Class
  </code></pre>