This documentation is archived and is not being maintained.

Point.Equals Method (Point, Point)

Compares two Point structures for equality. Note: Point coordinates are described using Double values. Because the value of a Double can lose precision when operated upon, a comparison between two Double values that are logically equal might fail.

Namespace: System.Windows
Assembly: WindowsBase (in windowsbase.dll)

public static bool Equals (
	Point point1,
	Point point2
)
public static boolean Equals (
	Point point1, 
	Point point2
)
public static function Equals (
	point1 : Point, 
	point2 : Point
) : boolean
You cannot use methods in XAML.

Parameters

point1

The first point to compare.

point2

The second point to compare.

Return Value

true if point1 and point2 contain the same X and Y values; otherwise, false.

The following example shows how to check if two Point structures are equal using the static Equals method.

private Boolean staticEqualsExample()
{

    Point point1 = new Point(10, 5);
    Point point2 = new Point(15, 40);

    // Check if the two points are equal using the static Equals method.
    // areEqual is false
    Boolean areEqual = Point.Equals(point1, point2);

    return areEqual;

}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: