WPF DragDrop.DoDragDrop(用于右键单击?)

发布于 2024-10-08 09:01:53 字数 424 浏览 0 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一场春暖 2024-10-15 09:01:53

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文