05-04-2011, 10:46 AM
Well that was easy.
Here it is... (sorry for not working on the GUI)
Here it is... (sorry for not working on the GUI)
Code:
Public Class Form1
Dim SW As New System.Diagnostics.Stopwatch
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
SW.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = String.Format("{0}:{1}:{2}:{3}", SW.Elapsed.Hours.ToString, SW.Elapsed.Minutes.ToString, SW.Elapsed.Seconds.ToString, SW.Elapsed.Milliseconds.ToString)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Timer1.Stop()
SW.Reset()
Label1.Text = "0:0:0:000"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
SW.Stop()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Timer1.Enabled = True
SW.Start()
End Sub
End Class