Bagikan melalui


StylusDevice.GetPosition(IInputElement) Metode

Definisi

Mendapatkan posisi 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

Parameter

relativeTo
IInputElement

koordinat IInputElement (x,y) yang dipetakan.

Mengembalikan

Point yang mewakili posisi stylus, dalam kaitannya dengan relativeTo.

Atribut

Pengecualian

Contoh

Contoh berikut menunjukkan GetPosition metode .

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)

Berlaku untuk