VB Code:
Private Sub Form_KeyDown(Keycode As Integer, Shift As Integer)
Call MoveObject(Image1, Keycode)
End Sub
Private Function MoveObject(Object As Object, Keycode As Integer)
Select Case Keycode
Case vbKeyUp
If Object.Top < 0 Then: Object.Top = Me.Height
Object.Top = Object.Top - 100
Exit Function
Case vbKeyDown
If Object.Top > Me.Height Then: Object.Top = 0
Object.Top = Object.Top + 100
Exit Function
Case vbKeyRight
If Object.Left > Me.Width Then: Object.Left = 0
Object.Left = Object.Left + 100
Exit Function
Case vbKeyLeft
If Object.Left < 0 Then: Object.Left = Me.Width
Object.Left = Object.Left - 100
Exit Function
End Select
End Function