Point.Equals Method (Object)

Determines whether the specified Object is a Point and whether it contains the same coordinates as this Point. Note: Point coordinates are described using Double values. Because the value of a Double can lose precision when operated upon, a comparison between two Doubles that are logically equal might fail.

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

public override bool Equals (
	Object o
)
public boolean Equals (
	Object o
)
public override function Equals (
	o : Object
) : boolean
You cannot use methods in XAML.

Parameters

o

The Object to compare.

Return Value

true if o is a Point and contains the same X and Y values as this Point; otherwise, false.

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

private Boolean nonStaticEqualsExample()
{

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

    // Check if the two points are equal using the non-static Equals method.
    // areEqual is false
    Boolean areEqual = point1.Equals(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

Community Additions

ADD
Show: