MouseEventArgs::Location Property

 

Gets the location of the mouse during the generating mouse event.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
property Point Location {
	Point get();
}

Property Value

Type: System.Drawing::Point

A Point that contains the x- and y- mouse coordinates, in pixels, relative to the upper-left corner of the form.

The following code example uses the Location property to track left mouse clicks and draw a series of straight line segments in response to user input. The example does not persist the drawn lines if you hide the form and then redisplay it; this code was omitted for simplicity.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: