Public
Class Form1
Private t As Integer
Private Sub
Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
End Sub
Private Sub
TimerStartStop()
Dim t2 As Integer
Timer1.Start()
MessageBox.Show("The Timer has just been
started. Click me to Stop!", "Timer
Announcement", MessageBoxButtons.OK, MessageBoxIcon.Asterisk,
MessageBoxDefaultButton.Button1, MessageBoxOptions.RtlReading)
Timer1.Stop()
t2 = t / 1000
MessageBox.Show(t2 & " Seconds have
elapsed!", "Time Taken")
End Sub
Private Sub
Timer1_Tick(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
Timer1.Tick
t += 100
End Sub
Private Sub
Button1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
Button1.Click
Me.Close()
End Sub
Private Sub
Button2_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
Button2.Click
TimerStartStop()
End Sub
End
Class