WPF DragDrop.DoDragDrop(用于右键单击?)
在 WPF 中,我想使用右键单击来启动拖放。像 Windows 资源管理器一样,右键单击,稍微移动,您就会得到装饰器来指示操作中的拖放。不要移动,当您松开按钮时,您会看到上下文菜单。
我已经启动了这一切,但是当我调用“DragDrop.DoDragDrop”时,它会立即掉落,不会等待鼠标松开。
我确实看到了这个链接Stack Overflow Question,它引用了一篇Silverlight文章并且需要 MouseCapture 并且它仅适用于左按钮。从字面上看,似乎根本不可能在 wpf 中执行右键单击拖动操作(如 windows)。我总是很难相信这样的事情:)(我确实尝试了 MouseCapture,但没有成功)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 MSDN 上找到了问题的解决方案论坛。主要思想是使用 DragDrop.AddQueryContinueDragHandler。
Found solution for your problem on MSDN forums. The main idea is to use DragDrop.AddQueryContinueDragHandler.