DoDragDrop 禁用 MouseMove 事件

DoDragDrop disables MouseMove Events(DoDragDrop 禁用 MouseMove 事件)
本文介绍了DoDragDrop 禁用 MouseMove 事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

在开始拖动 &DragDrop.DoDragDrop(...) 的拖放操作不再触发 MouseMove 事件.我什至尝试过

After having started a Drag & Drop operation by DragDrop.DoDragDrop(...) no more MouseMove Events are fired. I even tried

AddHandler(Window.MouseMoveEvent, new MouseEventHandler(myControl_MouseMove), true); 

最后一个参数意味着我什至选择处理已处理的事件.没有机会,似乎 MouseMove 事件根本没有被触发!使用 Drag & 时仍然获得 MouseMove 事件的任何方式降低?我想拖动 &放置一个控件,在拖动该控件时,它应跟随鼠标指针.知道在这种情况下如何做到这一点吗?

where the last parameter means I even opt in for handled events. No chance, seems like the MouseMove Event is never fired at all! Any way to still get MouseMove Events while using Drag & Drop? I'd like to Drag & Drop a control, while dragging this control it shall follow the mouse pointer. Any idea how to do this in this case?

推荐答案

你需要处理 DragOver 事件.

You need to handle the DragOver event.

编辑:尝试处理 GiveFeedback 事件 在您调用 DoDragDrop 的控件上;这可能会满足您的需求.

EDIT: Try handling the GiveFeedback event on the control that you called DoDragDrop on; that might do what you're looking for.

这篇关于DoDragDrop 禁用 MouseMove 事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)
Parameter count mismatch with Invoke?(参数计数与调用不匹配?)
How to store delegates in a List(如何将代表存储在列表中)
How delegates work (in the background)?(代表如何工作(在后台)?)
C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)
Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)