I'm using the below code to move a Picturebox around the Form area. It's fine for moving one Picturebox but how do I move all 4 pictureboxes at same time and keep their respective positions by just mouse down on one of the four?
Code:
Dim nX As Single
Dim nY As Single
Private Sub Picture1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
nX = X / Screen.TwipsPerPixelX
nY = Y / Screen.TwipsPerPixelY
End Sub
Private Sub Picture1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Picture1(Index).Move Picture1(Index).Left + ((X / Screen.TwipsPerPixelX)) - nX, Picture1(Index).Top + ((Y / Screen.TwipsPerPixelY)) - nY
End If
End Sub