Link to home
Start Free TrialLog in
Avatar of 5thcav
5thcavFlag for United States of America

asked on

get mouse_over on PBox while Dragging label onto PBox

DragLeave DragEnter DragDrop DragOver CursorChanged GotFocus

Nothing works while dragging... i also have PictureBox1.AllowDrop = True

i need to control the event b4 the user does a mouse up on the label....

basically i need to make sure the 20,20 label is on the pbox b4 releasing

the image in the label is the same as the cursor, when a use click and drags the label/image i set label visible false and change the cursor to that image
when the user does a mouse_up over the Pbox i swap the cursor with the label/image.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of eventprostrategies
eventprostrategies

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 5thcav

ASKER

im bulding an array of labels, with custom mouse events, when dragging a lable from its groupbox onto my picturebox that is also in another groupbox my picturebox events are not firing such as DragLeave DragEnter DragDrop DragOver CursorChanged GotFocus. i need to see if the label is over the picturebox b4 i allow the mouse up event from the label drag. this way i can return the label to its group box its not over the pbox. the label is set to drop in the same x,y location of the mouse up.

if i simply drag a label and use    Cursor.Clip = Me.RectangleToScreen(New Rectangle(PictureBox1.Location, PictureBox1.Size)) the label wont go pase
     
Avatar of 5thcav

ASKER

i wasnt ready to post my last message :)

I removed my label array (i only have 4 labels) thought maybe it was my custom events, but it wasnt

Avatar of 5thcav

ASKER

if i can get my Cursor.Clip working i should be all set.. it seems to be thinking my picturebox is somewhere else
Avatar of 5thcav

ASKER

       Me.Cursor = New Cursor(Cursor.Current.Handle)
        Cursor.Position = New Point(PictureBox1.Location.X - 10, PictureBox1.Location.Y - 10)
        Cursor.Clip = New Rectangle(PictureBox1.Location, PictureBox1.Size)

this should work but does not
Avatar of 5thcav

ASKER

 Cursor.Clip = PictureBox1.RectangleToScreen(PictureBox1.ClientRectangle)

this worked,, im all set,,, thanks