WPF DragDrop.DoDragDrop(用于RIGHT-Click?) [英] WPF DragDrop.DoDragDrop (for a RIGHT-Click?)

查看:435
本文介绍了WPF DragDrop.DoDragDrop(用于RIGHT-Click?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WPF中,我想使用右键单击启动拖放。像Windows资源管理器,右键单击,稍微移动,您可以让adorner指示一个拖放操作。不要动,当您放开按钮时,您将获得上下文菜单。



我已经启动了,但是当我调用DragDrop.DoDragDrop时,它会立即下降直到,它不等待鼠标向上。



我确实看到这个链接堆栈溢出问题,它指的是Silverlight文章,并且需要MouseCapture和它只适用于左按钮。从字面上看,似乎根本不可能在wpf中进行右键拖动操作(如windows)。我总是很难相信这样的事情:)(我没有尝试MouseCapture无效)

解决方案

找到解决方案问题在 MSDN论坛。主要思想是使用 DragDrop.AddQueryContinueDragHandler


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)

解决方案

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

这篇关于WPF DragDrop.DoDragDrop(用于RIGHT-Click?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆