StylusPoint.X Property

Gets or sets the value for the x-coordinate of the StylusPoint.

Namespace:  System.Windows.Input
Assembly:  System.Windows (in System.Windows.dll)


Public Property X As Double
public double X { get; set; }
<StylusPoint X="double"/>

Property Value

Type: System.Double
The x-coordinate of the StylusPoint in a pixel grid. The default is 0.


Exception Condition

X is set a value that evaluates to infinity or a value that is not a number.


The following code example demonstrates how to get the member X property. This is part of a larger example available in StylusPoint class overview.

    'StylusPoint objects are collected from the MouseEventArgs and added to MyStroke
    Private Sub MyIP_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
        If (Not (MyStroke) Is Nothing) Then
            XTB.Text = ("" + e.StylusDevice.GetStylusPoints(MyIP)(0).X)
            YTB.Text = ("" + e.StylusDevice.GetStylusPoints(MyIP)(0).Y)
            PressureTB.Text = ("" + e.StylusDevice.GetStylusPoints(MyIP)(0).PressureFactor)
        End If
    End Sub

//StylusPoint objects are collected from the MouseEventArgs and added to MyStroke
private void MyIP_MouseMove(object sender, MouseEventArgs e)
    if (MyStroke != null)
        XTB.Text = "" + e.StylusDevice.GetStylusPoints(MyIP)[0].X;
        YTB.Text = "" + e.StylusDevice.GetStylusPoints(MyIP)[0].Y;
        PressureTB.Text = "" + e.StylusDevice.GetStylusPoints(MyIP)[0].PressureFactor;

Version Information


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0


For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.