How would i go about trapping the mouse inside the picture box that i am drawing a line in? I have absolutely no idea how to do this. If someone could give me some pointers i would really appreciate this.
Printable View
How would i go about trapping the mouse inside the picture box that i am drawing a line in? I have absolutely no idea how to do this. If someone could give me some pointers i would really appreciate this.
Yes, in fact, I'll give you an working example that you can use.
Also, if you want to learn, reserch ClipCursor.Code:Public Declare Function KeepKursor Lib "user32" _
Alias "ClipCursor" (lpRect As Any) As Long
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Sub CursorR(PictureB As PictureBox)
Dim rrt As Rect
rrt.Left = PictureB.Left
rrt.Top = PictureB.Top
rrt.Right = PictureB.Left + Picture1.Width
rrt.Bottom = PictureB.Top + Picture1.Height
KeepKursor(rrt)
End Sub