WPF DragDrop.DoDragDrop (for a RIGHT-Click?)

為{幸葍}努か 提交于 2019-12-23 16:49:39

问题


In WPF I want to do initiate a drag-drop using the right click. Something like windows explorer, right click, move slightly and you get the adorner to indicate a drag drop in operation. Don't move and you get the context menu when you let up the button.

I have it all initiated but when I call the "DragDrop.DoDragDrop" it immediately falls right through, it doesn't wait for the mouse up.

I did see this link Stack Overflow Question and it refers to a Silverlight article and the need for the MouseCapture AND it only works with the Left button. Taken literally, it would seem that it is simply not possible to do a right click drag operation (like windows) in wpf. I always have a tough time believing such things :) (I did try the MouseCapture to no avail)


回答1:


Found solution for your problem on MSDN forums. The main idea is to use DragDrop.AddQueryContinueDragHandler.



来源:https://stackoverflow.com/questions/4476547/wpf-dragdrop-dodragdrop-for-a-right-click

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!