Key press event

crazymarvin

Member
Joined
Nov 22, 2006
Messages
18
Location
Belfast, UK
Programming Experience
Beginner
Hey, Im makeing a game and I want to be able to start a new game when the F4 button is pressed. So far I have this:
VB.NET:
    Private Sub frmGame_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.F4 Then
            MsgBox("you pressed F4")
        End If
    End Sub
However this only works for the first time F4 is pressed, if you press it a second time the message box will not appear.

Any ideas what im doin wrong?

many thanks
 
Back
Top