如何在拖放中检测错误的目的地 [英] How to detect wrong destination in drag&drop

查看:54
本文介绍了如何在拖放中检测错误的目的地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为拖放功能设置了代码。

I made codes for drag&drop feature.

一切正常,除非鼠标放在错误的放置位置。

Everything works fine except the case which mouse up where the wrong drop position.

例如,拖动从source的mouse_down事件开始,并以目的地的DragDrop事件结束。

For example, drag starts from source's mouse_down event and ends in destinations's DragDrop event.

但是,我不知道如何检测鼠标是否在目的地之外完成。

However, I don't know how to detect the mouse up is done out of the destination.

有人可以给我一些建议吗?

Can somebody give me some advice?

推荐答案

你好Jeff0803,

Hi Jeff0803,

感谢您在此发帖。

对于您的问题,您可以在完成鼠标操作时捕获位置。并设置一个目的地来比较该位置是否在。

For your question, you could capture the position when mouse up is done. And set a destination to compare whether the position is in or not.

最好的问候,

Wendy


这篇关于如何在拖放中检测错误的目的地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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