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
Spolupráca s nami v službe GitHub
Zdroj tohto obsahu nájdete v službe GitHub, kde môžete vytvárať a skúmať problémy a žiadosti o prijatie zmien. Ďalšie informácie nájdete v našom sprievodcovi prispievateľom.