handle it with keyDown Event.
this following code is form keydown event, you can do same with other controls.
Private Sub Search_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Up Then
'PictureBox1.Top -= 10
MsgBox("Key Up Pressed")
ElseIf e.KeyCode = Keys.Down Then
'PictureBox1.Top += 10
MsgBox("Key Top Pressed")
ElseIf e.KeyCode = Keys.Left Then
'PictureBox1.Left -= 10
MsgBox("Key Left Pressed")
ElseIf e.KeyCode = Keys.Right Then
'PictureBox1.Left += 10
MsgBox("Key Right Pressed")
End If
End Sub
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444