jes152003
Crypto Fund Manager
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
200 XP
In this tutorial I’m going to teach you how to create split timer using visual basic.net. To start in this course you need to download first the “Digital stopwatch” which we’re going to use in this tutorial. You can follow this link to download this progam;http://www.sourcecodester.com/tutor.../digital-stopwatch-using-visual-basicnet.html.
Here’s the sample screenshots if you completed this course and it looks like as shown below.
This this time you need to add one button for “Split” and one Datagridview. And name the new button as “btnSplit” and the Text is “Split”, and set the Datagridview AutoSizeColumnMode in to “Fill” and Uncheck the “Enable Adding”.
Next let’s start coding. To do this double click the form load and add this code. And it should be looks like as shown below.
Next set the "Start" button to Disable when the timer is running. To do this just follow this code.
Next double click the “Split” button and add this code.
At first it will give you an error because DT is not yet declared. So to avoid this error we need to declare this above below public class together with another declaration of variable.
After this you can now test by running your program. The process would be the user will click the “Start” button and the timer will start running and as you observe the “Start” button will be disabled. Next when the user click the “Split” button the value of the text box will then now display in the datagridview in descending order. And everything will follow based on the choice.
Download
Here’s the sample screenshots if you completed this course and it looks like as shown below.

This this time you need to add one button for “Split” and one Datagridview. And name the new button as “btnSplit” and the Text is “Split”, and set the Datagridview AutoSizeColumnMode in to “Fill” and Uncheck the “Enable Adding”.
Next let’s start coding. To do this double click the form load and add this code. And it should be looks like as shown below.
- Private
Sub
Form1_Load(
ByVal
sender As
System.
Object
, ByVal
e As
System.
EventArgs
)
Handles
MyBase
.
Load
- 'it do the initialization
- 'add new column for our datagridview
- DT.
Columns
.
Add
(
"Split Time Record"
)
- 'get the datasource from Datatable named DT
- DataGridView1.
DataSource
=
DT
- 'set the sort mode of the datagrid into descending order.
- DataGridView1.
Sort
(
DataGridView1.
Columns
(
0
)
, System.
ComponentModel
.
ListSortDirection
.
Descending
)
- a =
"0"
- b =
"0"
- c =
"0"
- d =
"0"
- y =
"0"
- z =
"0"
- u =
"0"
- v =
"0"
- h =
a +
b
- m =
c +
d
- s =
y +
z
- 'display as "00:00:00.00"
- txttime.
Text
=
h +
":"
+
m +
":"
+
s +
"."
+
u +
v
- End
Sub
Next set the "Start" button to Disable when the timer is running. To do this just follow this code.
- 'start the timer
- Timer1.
Start
(
)
- 'check if the text of these button is set to continue set by pause button then it set to start
- If
BtnStart.
Text
=
"Start"
Then
- 'disable Start button
- BtnStart.
Enabled
=
False
- End
If
Next double click the “Split” button and add this code.
- DataGridView1.
Visible
=
True
- DT.
Rows
.
Add
(
txttime.
Text
)
At first it will give you an error because DT is not yet declared. So to avoid this error we need to declare this above below public class together with another declaration of variable.
- Dim
DT As
New
DataTable
After this you can now test by running your program. The process would be the user will click the “Start” button and the timer will start running and as you observe the “Start” button will be disabled. Next when the user click the “Split” button the value of the text box will then now display in the datagridview in descending order. And everything will follow based on the choice.
Download
You must upgrade your account or reply in the thread to view hidden text.