I'm wanting to make a old school timer like the picture below. How would I go about doing this in VD? I have tried it doing it with code bellow. The problem with this is that it starts with just seconds only adds the minutes section when you reach 1 minute.

enter image description here

Dim StartTime As DateTime
Dim PlayTime As TimeSpan

 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    StartTime = Now()
    End Sub

  Private Sub tmrCountUp_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrCountUp.Tick

    PlayTime = Now() - StartTime

    lblTime.Text = PlayTime.Hours & PlayTime.Minutes & PlayTime.Seconds

    lblTime.Text = lblTime.Text + 1
End Sub
  • 4
    \$\begingroup\$ You have tried, and what exactly isn't working? \$\endgroup\$
    – o0'.
    Apr 20 '12 at 12:43
  • 2
    \$\begingroup\$ Old school? What do "new school" timers look like? \$\endgroup\$
    – House
    Apr 20 '12 at 17:40

You can format using this: http://msdn.microsoft.com/en-us/library/6t7dwaa5.aspx or use string formatting (string.padleft I think)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.