Export (0) Print
Expand All

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 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.

ExceptionCondition
ArgumentOutOfRangeException

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 void MyIP_MouseMove(object sender, MouseEventArgs e)
{
    if (MyStroke != null)
    {
        MyStroke.StylusPoints.Add(e.StylusDevice.GetStylusPoints(MyIP));
        XTB.Text = "" + e.StylusDevice.GetStylusPoints(MyIP)[0].X;
        YTB.Text = "" + e.StylusDevice.GetStylusPoints(MyIP)[0].Y;
        PressureTB.Text = "" + e.StylusDevice.GetStylusPoints(MyIP)[0].PressureFactor;
    }
}


Silverlight

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.

Community Additions

ADD
Show:
© 2014 Microsoft