And this safety feature is provided by Windows, not Visual Basic. However, if you use the following alternate code, you can effectively bypass this feature.
This code is essentially same as IvanMoala provided you in thread707-942042, but it has the added advantage that it can work with any ScaleMode (other than twips) selected for the form, like pixels. I think this was the reason that code was not working properly as you mentioned in the other thread.
Also note that you can make this code to work with left, right, middle or any combination of these mouse buttons by modifying the Case statement in the MouseMove event.
___
[tt]
Dim XPos As Single, YPos As Single
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
XPos = X
YPos = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Select Case Button
Case vbLeftButton ', vbRightButton
Move Left + ScaleX(X - XPos, ScaleMode, vbTwips), Top + ScaleY(Y - YPos, ScaleMode, vbTwips)
End Select
End Sub [/tt]