StylusDevice.GetPosition(IInputElement) Methode

Definition

Ruft die Position des Tablettstifts ab.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);
member this.GetPosition : System.Windows.IInputElement -> System.Windows.Point
Public Function GetPosition (relativeTo As IInputElement) As Point

Parameter

relativeTo
IInputElement

Das IInputElement-Objekt, dem die (x,y)-Koordinaten zugeordnet sind.The IInputElement to which the (x,y) coordinates are mapped.

Gibt zurück

Ein Point, der die Position des Tablettstifts relativ zu relativeTo darstellt.A Point that represents the position of the stylus, in relation to relativeTo.

Attribute

Ausnahmen

Beispiele

Das folgende Beispiel veranschaulicht die GetPosition Methode.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)

Gilt für: