Get a Cursors HotSpot

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to get the hot spot location of the current cursor, so I can position
a form correctly.
Can someone please show me how to get a cursors hotspot location using C#
and .NET 1.1?

Thanks for your help.
 
The mouse' hotspot is the mouse cursor location, you can get it from the
MouseEventArgs, these args are exposed in OnMouseDown, OnMouseUp,
OnMouseMove...
you can get the location using e.X and e.Y, or e.Location

if you need the screen location for the mouse you can do
this.PointToScreen(point) and you can convert it back to client coordinates
((0,0) is at the top left of the form/control) using
this.PointToClient(point)
 
Back
Top