0
\$\begingroup\$

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
\$\endgroup\$
2
  • 4
    \$\begingroup\$ You have tried, and what exactly isn't working? \$\endgroup\$
    – o0'.
    Apr 20, 2012 at 12:43
  • 2
    \$\begingroup\$ Old school? What do "new school" timers look like? \$\endgroup\$
    – House
    Apr 20, 2012 at 17:40

1 Answer 1

1
\$\begingroup\$

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

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .