How to get mouse position over a certain control

独自空忆成欢 提交于 2019-12-18 05:59:25

问题


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.


回答1:


Try Control.PointToClient and Control.PointToScreen.



来源:https://stackoverflow.com/questions/465545/how-to-get-mouse-position-over-a-certain-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!