本文介绍了添加拖放后 CellDoubleClick 事件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
在我添加了拖动 &拖放到 DataGridView,CellDoubleClick 事件停止工作.在 CellMouseDown 事件中,我有以下代码:
After I added drag & drop to a DataGridView, the CellDoubleClick event stopped working. In the CellMouseDown event I have the following code:
如何更正此问题以启用 CellDoubleClick 事件?
How do I correct this to enable CellDoubleClick event?
推荐答案
是的,那行不通.调用 DoDragDrop() 将鼠标控制移交给 Windows D+D 逻辑,这将干扰正常的鼠标处理.您需要延迟启动 D+D,直到您看到用户实际拖动.这应该可以解决问题:
Yes, that cannot work. Calling DoDragDrop() turns mouse control over to the Windows D+D logic, that's going to interfere with normal mouse handling. You need to delay starting the D+D until you see the user actually dragging. This ought to solve the problem:
这篇关于添加拖放后 CellDoubleClick 事件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!