StylusDevice.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.
Gets the position of the stylus.
public:
System::Windows::Point GetPosition(System::Windows::IInputElement ^ relativeTo);
[System.Security.SecurityCritical]
public System.Windows.Point GetPosition (System.Windows.IInputElement relativeTo);
public System.Windows.Point GetPosition (System.Windows.IInputElement relativeTo);
[<System.Security.SecurityCritical>]
member this.GetPosition : System.Windows.IInputElement -> System.Windows.Point
member this.GetPosition : System.Windows.IInputElement -> System.Windows.Point
Public Function GetPosition (relativeTo As IInputElement) As Point
Parameters
- relativeTo
- IInputElement
The IInputElement to which the (x,y
) coordinates are mapped.
Returns
A Point that represents the position of the stylus, in relation to relativeTo
.
- Attributes
Exceptions
relativeTo
is neither UIElement or FrameworkContentElement.
Examples
The following example demonstrates the GetPosition method.
Point myPoint = myStylusDevice.GetPosition(myStylusDevice.Target);
textbox1.AppendText("The relative position is: (" + myPoint.X.ToString() + "," + myPoint.Y.ToString() + ")\n");
Dim myPoint As Point = myStylusDevice.GetPosition(myStylusDevice.Target)
textbox1.AppendText("The relative position is: (" + myPoint.X.ToString() + "," + myPoint.Y.ToString() + ")" + vbCrLf)
Applies to
Samarbeid med oss på GitHub
Du finner kilden for dette innholdet på GitHub. Der du også kan opprette og se gjennom problemer og pull-forespørsler. Hvis du vil ha mer informasjon, kan du se vår bidragsyterveiledning.