In the April 2010 release I've noticed that code that used to work fine in the March 2010 release is now behaving strangely. I have a ListBox that is wrapped in a ListBoxDragDropTarget element. When I click on an item in the list box to select it, sometimes a drag operation is started even though I did not hold down the mouse button. It seems to be fairly repeatable but not consistent. I can't detect a pattern.
Inside the ListBoxItem is an object which is listening to mouse events for detecting double click so I will investigate that and report back but I just wanted to post this in case anyone else is noticing the same thing.
Comments: ** Comment from web user: jandersen78 **
Inside the ListBoxItem is an object which is listening to mouse events for detecting double click so I will investigate that and report back but I just wanted to post this in case anyone else is noticing the same thing.
Comments: ** Comment from web user: jandersen78 **
I think I get where andy2001p was going with his change... essentially use the OnQueryContinueDrag hook to cancel the drag operation if you find that the mouse left button is up. However, I found that this prevented ANY drag operation from succeeding because, in a normal drag, OnQueryContinueDrag is called BEFORE the drop handlers so it appears my drops were being cancelled just before they should've succeeded. I simply changed his code block to set DragAction.Drop instead of DragAction.Cancel and that SEEMS to be working well for my needs (I'm working with a custom DragDropTarget). The effect is simply to immediately trigger a drop if you find that the mouse is no longer down.