Simply change it to this :
VB Code:
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e
As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = Keys.Right Then
MsgBox("Right Key Pressed!")
End If
End Sub
Private Sub TextBox2_KeyDown(ByVal sender As Object, ByVal e
As System.Windows.Forms.KeyEventArgs) Handles TextBox2.KeyDown
If e.KeyCode = Keys.Left Then
MsgBox("Left Key Pressed!")
End If
End Sub
I don't know why you declared two variables ? It could work if you just assigned them the ascii codes for left & right keys .