Public Class Form1 Private watch As New Stopwatch() Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick Label1.Text = watch.Elapsed.ToString() End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Button1.Text = "開始/停止" Button2.Text = "リセット" Timer1.Interval = 20 Timer1.Enabled = True End Sub Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click If watch.IsRunning Then watch.Stop() Else watch.Start() End If End Sub Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click watch.Reset() End Sub End Class