Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 4
System.Windows
Point Structure
Point Properties
 Y Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2010/.NET Framework 4

Other versions are also available for the following:
.NET Framework Class Library
Point..::.Y Property

Gets or sets the Y-coordinate value of this Point.

Namespace:  System.Windows
Assembly:  WindowsBase (in WindowsBase.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Visual Basic
Public Property Y As Double
    Get
    Set
C#
public double Y { get; set; }
Visual C++
public:
property double Y {
    double get ();
    void set (double value);
}
F#
member Y : float with get, set
XAML Attribute Usage
<object Y="double" .../>

Property Value

Type: System..::.Double
The Y-coordinate value of this Point structure. The default value is 0.

The following example shows how to check if two Point structures are not equal. It also illustrates how to assign values to a Point structure when the structure is being declared and after the structure has been declared.

Visual Basic
        ' Checks if two Points are equal using the overloaded inequality operator.
        Private Function pointInequalityExample() As Boolean
            ' Checks if two Points are not equal using the overloaded inequality operator.

            ' Declaring point1 and initializing x,y values
            Dim point1 As New Point(10, 5)

            ' Declaring point2 without initializing x,y values
            Dim point2 As New Point()

            ' Boolean to hold the result of the comparison
            Dim areNotEqual As Boolean

            ' assigning values to point2
            point2.X = 15
            point2.Y = 40

            ' Compare Point structures for equality.
            ' areNotEqual is True
            areNotEqual = (point1 <> point2)

            Return areNotEqual

        End Function
C#
// Checks if two Points are equal using the overloaded inequality operator.
private Boolean pointInequalityExample()
{
    // Checks if two Points are not equal using the overloaded inequality operator.

    // Declaring point1 and initializing x,y values
    Point point1 = new Point(10, 5);

    // Declaring point2 without initializing x,y values
    Point point2 = new Point();

    // Boolean to hold the result of the comparison
    Boolean areNotEqual;

    // assigning values to point2
    point2.X = 15;
    point2.Y = 40;

    // Compare Point structures for equality.
    // areNotEqual is True
    areNotEqual = (point1 != point2);

    return areNotEqual;

}

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker