DoDragDrop disables MouseMove Events(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 事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:DoDragDrop 禁用 MouseMove 事件


- 是否可以在 .Net 3.5 中进行通用控件? 2022-01-01
- 在 C# 中异步处理项目队列 2022-01-01
- CanBeNull和ReSharper-将其用于异步任务? 2022-01-01
- Azure Active Directory 与 MVC,客户端和资源标识同一 2022-01-01
- C# 通过连接字符串检索正确的 DbConnection 对象 2022-01-01
- 使用 rss + c# 2022-01-01
- 在 LINQ to SQL 中使用 contains() 2022-01-01
- 为什么 C# 中的堆栈大小正好是 1 MB? 2022-01-01
- Windows 喜欢在 LINUX 中使用 MONO 进行服务开发? 2022-01-01
- 带问号的 nvarchar 列结果 2022-01-01