检查拖放和拖放是否正在进行 [英] Check if a drag&drop is in progress

查看:83
本文介绍了检查拖放和拖放是否正在进行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法检查拖放是否正在进行中?某些方法或win32 api可以检查?我知道我可以设置AllowDrop并使用事件,但在这种情况下不起作用。基本上,我想检查代码,如果任何拖放正在进行。

解决方案

我有一个类似的问题,我回答了自己(经过几个小时搞砸了),见 - 如何判断一个拖放在Winforms中已经结束?



基本上如果你做为earwicker建议当DoDragDrop调用附近的拖动开始时,您需要设置标志。如果QueryContinueDragEventArgs指示删除或取消,则需要在DragDrop事件和QueryContinueDrag中取消设置标志。


Is there any way to check if a drag and drop is in progress? Some method or win32 api which can be checked? I know I can set AllowDrop and use events but it doesn't work in this case. Basically i want to check, with code, if any drag&drop is in progress.

解决方案

I had a similar question which I answered myself (after some hours messing about) See - How do I tell if a Drag Drop has ended in Winforms?.

Basically if you do as earwicker suggests you need to set the flag when the drag drop begins near the DoDragDrop call. You will need to unset the flag in both the DragDrop event and in the QueryContinueDrag if the QueryContinueDragEventArgs indicate a drop or a cancel.

这篇关于检查拖放和拖放是否正在进行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆