This moves a picturebox around the screen but the same methods can be used to move other controls as well. First set the form's KeyPreview property to True, then add this code:
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Const NUDGE = 100
Select Case KeyCode
Case vbKeyRight
If Picture1.Left + Picture1.Width + NUDGE >= Form1.ScaleWidth Then
' The picture has reached or almost reached the right-hand
' border of the form. Move it only as far as it can go without
' it crossing the border.
Picture1.Left = Form1.ScaleWidth - Picture1.Width
Beep
Else
Picture1.Left = Picture1.Left + NUDGE
End If
Case vbKeyLeft
If Picture1.Left - NUDGE <= 0 Then
Picture1.Left = 0
Beep
Else
Picture1.Left = Picture1.Left - NUDGE
End If
Case vbKeyUp
If Picture1.Top - NUDGE <= 0 Then
Beep
Picture1.Top = 0
Else
Picture1.Top = Picture1.Top - NUDGE
End If
Case vbKeyDown
If Picture1.Top + Picture1.Height + NUDGE >= Form1.ScaleHeight Then
Beep
Picture1.Top = Form1.ScaleHeight - Picture1.Height
Else
Picture1.Top = Picture1.Top + NUDGE
End If
End Select
End Sub