-----------------------------------------------------------------------------------------------------------
Add a label to the form and change it's text to 00:00:00:000
To do that right click on the label and click on properties.
Change the font's size of the label. In the properties window, go to Font. The font dialog will show up. Under the size, choose the number 28 then click Ok.
Add a timer to the form. Right click on Timer1 and click on properties. In the properties window, change the interval property to 1.
Drag a listbox from the toolbox into the form.
Add a 3 buttons to the form and change it's text to Mark, Start, and Reset.
--------- CODES -------------------------------------------------------------------------------------------------
Form:
Public Class Form1 Private stopwatch As New Stopwatch End Class
Timer:
Dim elapsed As TimeSpan = Me.stopwatch.Elapsed
Label1.Text = String.Format("{0:00}:{1:00}:{2:00}:{3:00}", _
Math.Floor(elapsed.TotalHours), _
elapsed.Minutes, elapsed.Seconds, _
elapsed.Milliseconds)
Start:
Timer1.Start() Me.stopwatch.Start() Button4.Enabled = False
Stop:
Timer1.Stop() Me.stopwatch.Stop() Button4.Enabled = True
Reset:
Me.stopwatch.Reset() Label1.Text = "00:00:00:00" ListBox1.Items.Clear()
Mark
ListBox1.Items.Add(ListBox1.Items.Count + 1 & " " & Label1.Text)
Hope This Helped!!!
Edited by CuzImAwesome, 21 October 2010 - 06:57 AM.


Sign In
Create Account


Back to top









