Use the mouse move event on the form.
' This assumes that you have a picture on your form called Image1
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Left = X + 2
Image1.Top = Y + 2
End Sub
If you want to drop the image, simply capture the mouseup or mousedown event and then set the Image's left and top to X, Y respectively. In addition, you might want a public boolean that lets the system know if you want to move the image or not, like this:
' This assumes that you have a picture on your form called Image1
Dim Moving As Boolean
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Moving = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Left = X + 2
Image1.Top = Y + 2
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Moving = False
Image1.Left = X
Image1.Top = Y
End Sub
Hope this helps,
Chi
They mostly come at night...mostly.