Share via


StylusDevice.GetPosition(IInputElement) 方法

定義

取得手寫筆的位置。

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

參數

relativeTo
IInputElement

IInputElement對應 (x,y) 座標的 。

傳回

表示手寫筆位置的 Point,與 relativeTo 有關。

屬性

例外狀況

範例

下列範例示範 GetPosition 方法。

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)

適用於