0
所以我想寫一些簡單的代碼,當按下「g」鍵時打開或關閉某些東西。我就讓你看看代碼,並希望它是什麼盯着我的臉......e.KeyCode不想爲我工作
Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs)
If e.KeyCode = Keys.G Then
If Label2.Text = "Off" Then
Label2.Text = "On"
Label2.ForeColor = Color.Green
Else
Label2.Text = "Off"
Label2.ForeColor = Color.Red
End If
End If
End Sub