How to get mouse position over a certain control
14,518
Try Control.PointToClient and Control.PointToScreen.
Author by
Dustin Brooks
Updated on June 12, 2022Comments
-
Dustin Brooks almost 2 years
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. -
theJerm about 11 yearsThis answer could be improved with the code sample being put here instead of a link away.
-
mqp about 11 yearsWell you can feel free to edit it and put that code sample right in.
-
theJerm about 11 yearsI haven't figured out what the code should be yet or I would :)