如何克服一定的控制鼠标位置 [英] How to get mouse position over a certain control

查看:151
本文介绍了如何克服一定的控制鼠标位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows窗体结果
我使用一个layoutpanel和DragEventArgs DragOver事件返回X / Y鼠标相对于屏幕坐标。我知道有在鼠标在控件的位置翻译这个功能,但我有很难找到它。

Windows Form
I'm using the DragOver event on a layoutpanel and the DragEventArgs returns the X/Y coordinates of the mouse in relation to the screen. I know there is a function to translate this in to the position of the mouse over the control, but I'm having difficulty locating it.

推荐答案

尝试 Control.PointToClient 并的 Control.PointToScreen

这篇关于如何克服一定的控制鼠标位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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