DropTarget: which DnD action?

Hi All,

Is there a way to know which drag-and-drop action should be performed on the target side?
I found the source gets it as a result from DoDragDrop().

To clarify: I’m working with files, use FileDropTarget and drop FileDataObject towards it.
If the user requests a DragMove, I would like to try actually move the file instead of copying it and delete the original. But if the user requests a DragCopy the file will be copied.


There is a flag passed to the OnData and OnDragOver methods of DropTarget that lets you know what the user is requesting. There is a bug in 4.1.0 related to this, so if you’re using that version then you’ll probably want to use the latest snapshot build until there is a new release.

Thank you, Robin.

Yes. I found that, too. Currently I’m intercepting DragOver to remember the flag for use in OnDrop / OnDropFiles. Not really elegant, but it now works as I like.

Side note: We exchanged some brief messages over 10 years ago. Amazing you’re still actively supporting wxPython. Thank you for that, too.