It seems to me there is no way to detect whether a drag operation was successful or not, but there must be some way. Suppose that I want to perform a "move" from the source to the destination. If the user releases the mouse over some app or control that cannot accept the drop, how can I tell?
For that matter, how can I tell when the drag is completed at all?
I saw this question, but his solution does not work for me, and e.Action
is always Continue
.
I'm not sure if that can help you, but DoDragDrop method returns final DragDropEffects value.
var ret = DoDragDrop( ... );
if(ret == DragDropEffects.None) //not successfull
else // etc.
Ah, I think I've got it. Turns out the call to DoDragDrop is actually synchronous (how lame), and returns a value of DragDropEffects
, which is set to None
if the op fails. So basically this means the app (or at least the UI thread) will be frozen for so long as the user is in the middle of a drag. That does not seem a very elegant solution to me.
Ok cz_dl I see you just posted that very thing so I'll give u the answer.
This I don't understand though: how can the destination determine whether the op should be a move or a copy? Shouldn't that be up to the source app?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With