Public Class Form1
    Public sum As Short
    Public path As String = My.Computer.FileSystem.CurrentDirectory & "\"
    Dim img As Bitmap         '宣告img為 Bitmap 點矩陣資料型別，用來放拉霸拉桿的圖片

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Static count As Short  'count為靜態變數，用來記錄拉霸次數
        img = New Bitmap(path + "on.jpg")
        Button1.Image = img    '更換拉桿圖片
        Timer1.Enabled = True
        count += 1             '計算拉霸次數
        TextBox3.Text += count & vbCrLf
        Call Show_pic()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        img = New Bitmap(path + "off.jpg")
        Button1.Image = img    '更換拉桿圖片
        Timer1.Enabled = False
    End Sub
End Class
