Lap Timer using Visual Basic.Net
Submitted by joken on Wednesday, September 11, 2013 - 17:30.
In today’s lesson, we are going to create a Lap timer using visual basic. To start with, we need the “Split Timer Using Visual Basic.Net”. Download it and continue with our tutorial below.
Let’s begin our tutorial. First change the property name of “Split” button into “btnLap” from “btnsplit”, then we'll change also the Text property of this button into “Lap” from “Split”. Then as expected it looks like as shown below.
Then let’s add the code to the “Lap” button, and here’s the code.
And you can test our program now if it is really running. Thanks for reading folks.

- Dim mesage As String
- mesage = "Click start first before you click Lap timer."
- 'it check if the timer is running then
- If Timer1.Enabled = True Then
- 'it will refresh the datagridview
- DataGridView1.Refresh()
- 'get the data from the textbox and pass it into datagridview as a record of lap time
- DT.Rows.Add(txttime.Text)
- 'it calls the btnrestart button to execute so that it will reset the timer
- btnrestart_Click(sender, e)
- Else
- 'this message will show if the timer is not not running that you click the lap button
- MessageBox.Show(mesage, "Stopwatch", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1)
- End If
Add new comment
- 595 views