Since your DragAdorner
is always under your cursor, it will be the object receiving the drop. If you set IsHitTestVisible = false;
in the constructor for the Adorner
, it should fix this.
Even though you haven't set AllowDrop
on the Adorner
, since it is under the cursor, it will intercept the drop attempt. But since it doesn't accept drop, it will just cancel it.
Update
The other issue is that you are setting the allowed effects in your drag operation to DragDropEffects.Copy
, but in the DragOver
and Drop
handlers, you're trying to do a DragDropEffects.Move
. This won't work, as those are not the same operation. These must match. If you want to enable both operations on drag, you can specify both with a bitwise or:
DragDrop.DoDragDrop(source, dragData, DragDropEffects.Copy | DragDropEffects.Move);
Update 2
If you want to drop anything other than a string
onto a TextBox
, you have to use the PreviewDrop
and PreviewDragOver
events. Otherwise, the TextBox
's default handling will ignore anything else. So it would look like this:
tbox.PreviewDrop += new DragEventHandler(tbox_PreviewDrop);
tbox.PreviewDragOver += new DragEventHandler(tbox_DragOver);