I wrote an C# application that uses drag and drop to copy the contents of
one ListViewItem to another. I call DoDragDrop() in the ItemDrag event
handler, however, the ItemDrag event is being fired when an item in the
ListView is clicked to select it instead of being fired when the item is
dragged.
This is causing a problem when users click on an item and move the moue
(after the mouse button has been released) because the app tries to perform
the drag and drop operation, copy, even though the item wasn't dragged to
another item before the mouse button was released.
I have tried implementing handlers for the MouseUpand QueryContinueDr ag
events to cancel the drag and drop if the mouse button is released over the
selected item. Neither event handler is hit before the mouse is moved off
the selected item.
I need to find a way to cancel the drag or even better to find out how to
prevent ItemDrag from firing when the ListViewitem is clicked on to select
it.
Has anyone got any suggestions about how to solve this problem?
Thanks,
Tom