Open up visual basic and make a windows form named anything you want.
The GUI:
Insert 3 buttons, and a label.
Name one button's text: Start
Second Button: Pause
Third Button: Stop
Name the label: 0.00
Insert a timer make it not enabled and a interval of: 1
The Code:
Double Click the start button:
Turn on the timer
Double click the pause button and turn off timer
Double Click Stop Button and turn off timer and reset the label to 0.0
Double click the timer and make the label tick by 0.01
Final Code:
The GUI:
Insert 3 buttons, and a label.
Name one button's text: Start
Second Button: Pause
Third Button: Stop
Name the label: 0.00
Insert a timer make it not enabled and a interval of: 1
The Code:
Double Click the start button:
Turn on the timer
Code
Timer1.Enabled = TrueDouble click the pause button and turn off timer
Code
Timer1.Enabled = FalseDouble Click Stop Button and turn off timer and reset the label to 0.0
Code
Timer1.Enabled = False
Label1.Text = 0.0Double click the timer and make the label tick by 0.01
Code
Label1.Text = Label1.Text + 0.01Final Code:
Code
Public Class Form1
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Timer1.Enabled = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = False
Label1.Text = 0.0
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = Label1.Text + 0.01
End Sub
End Class

