How to cancle drag and drop

B

Boni

Dear all,
if an object draged on the certain place on the control I would like to
cancel drag and drop. But from MSDN:
"The QueryContinueDrag event is raised when there is a change in the
keyboard or mouse button state during a drag-and-drop operation"
But if there is no such operation can I somehow cancel drag&drop?
I tried to raise this event but complier complains, that I can't raise event
in the base class.
Is there any solution?
Thanks,
Boni
 
N

ng

You can look in the DragDrop event of the object, check the mouse
location, object.MousePosition, then if it doesn't meet your criteria
set e.Effect = Windows.Forms.DragDropEffects.None, which will not allow
the drop to occur.

Tom
 
B

Boni

But I want to cancel Drag and Drop action. Not just prohibit a drop on
special place. Is it possible?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top