You could limit the Area in which the Cursor can move, eg.
Code:
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
Private tRect As RECT
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbLeftButton Then
tRect.Left = ScaleX(Left, vbTwips, vbPixels)
tRect.Top = ScaleY(Top, vbTwips, vbPixels)
tRect.Right = ScaleX(Left + Width, vbTwips, vbPixels)
tRect.Bottom = ScaleY(Top + Height, vbTwips, vbPixels)
Call ClipCursor(tRect)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbLeftButton Then Call ClipCursor(ByVal 0&)
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]