Question

After having started a Drag & Drop operation by DragDrop.DoDragDrop(...) no more MouseMove Events are fired. I even tried

AddHandler(Window.MouseMoveEvent, new MouseEventHandler(myControl_MouseMove), true); 

where the last parameter means I even opt in for handled events. No chance, seems like the MouseMove Event is never fired at all! Any way to still get MouseMove Events while using Drag & Drop? I'd like to Drag & Drop a control, while dragging this control it shall follow the mouse pointer. Any idea how to do this in this case?

Was it helpful?

Solution

You need to handle the DragOver event.

EDIT: Try handling the GiveFeedback event on the control that you called DoDragDrop on; that might do what you're looking for.

OTHER TIPS

What is the DragDrop.DoDragDrop construction? DoDragDrop is intended to be called in MouseDown/MouseMove method indeed, not in DragDrop. It is supposed to START handling the procedure, not to react for the drop (the desired effect of the drop you just implement directly in DragDrop). MouseMove never fires while already dragging, perhaps that's why it does not also fire with you, since you set the procedure. I think you handle this wrong way, here is one of examples http://msdn.microsoft.com/en-us/library/aa984430%28v=vs.71%29.aspx.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top