I've included the following code into a program I'm working on under the form1 class, and it's not hitting the event whenever I press a key. I tried putting a debug stop on the line where the event is called, and when I push a key while the program's running, nothing happens. Could anyone tell me what could make this happen? I tried making sure the focus was on the form by setting Form1.KeyPreview = true and it didn't help. Any ideas would be appreciated:
Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
Select Case e.KeyCode
Case Keys.Right
BItem.Right()
Case Keys.Left
BItem.Left()
Case Keys.Up
BItem.Up()
Case Keys.Down
BItem.Down()
End Select
End Sub
Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
Select Case e.KeyCode
Case Keys.Right
BItem.Right()
Case Keys.Left
BItem.Left()
Case Keys.Up
BItem.Up()
Case Keys.Down
BItem.Down()
End Select
End Sub