Public Class frmWhoIsFaster
Dim player1clicks As Integer
Dim player2clicks As Integer
Dim startgame As Boolean = True
Private Sub frmWhoIsFaster_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If startgame = True Then
Select Case e.KeyCode
Case Keys.A
player1clicks += 1
lblPlayer1Clicks.Text = "Player 1 clicks: 1" & player1clicks
Case Keys.L
player2clicks += 1
lblPlayer2Clicks.Text = "Player 2 clicks: " & player2clicks
End Select
End If
End Sub
End Class
按A或L时标签永远不会改变