MouseEventArgs.GetPosition(IInputElement) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the position of the mouse pointer relative to the specified element.
public:
System::Windows::Point GetPosition(System::Windows::IInputElement ^ relativeTo);
public System.Windows.Point GetPosition (System.Windows.IInputElement relativeTo);
member this.GetPosition : System.Windows.IInputElement -> System.Windows.Point
Public Function GetPosition (relativeTo As IInputElement) As Point
Parameters
- relativeTo
- IInputElement
The element to use as the frame of reference for calculating the position of the mouse pointer.
Returns
The x- and y-coordinates of the mouse pointer position relative to the specified object.
Remarks
The point (0,0) is the upper-left corner of the frame of reference.
The static Mouse.GetPosition method can also be used to obtain the position of the mouse.