Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Point.X Property

Gets or sets the X-coordinate value of this Point structure.

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

public double X { get; set; }
<object X="double" .../>

Property Value

Type: System.Double
The X-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.

// 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.5.3, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft