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 事件
基础教程推荐
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
