Y Property
Collapse the table of content
Expand the table of content

StylusPoint.Y Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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

Namespace:  System.Windows.Input
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public double Y { get; set; }
<StylusPoint Y="double"/>

Property Value

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

ExceptionCondition
ArgumentOutOfRangeException

Y 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 Y 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;
    }
}


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft