Asked By
300 points
N/A
Posted on - 04/28/2011
Best Answer
Best Answer
Code of stop watch in VB.net
Hi
Using vb.net you can create a stop watch. first of all, insert a timer control in the form; then enable it to start the time in a text box and disable while you want to stop.
Code of stop watch in VB.net
Here is the code for inserting a stop watch:
Private Sub btnstart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnstart.Click, Timer1.Tick
timebox.Text = DateTime.Now.ToString("hh/mm/ss")
Timer1.Enabled = True
End Sub
Code of stop watch in VB.net
The timer can be stopped using this code:
Private Sub Button2_Click(ByVal sender As System. Object, ByVal e As System.EventArgs) Handles Button2.
Click
Timer1.Enabled = False
End Sub