Point.Equality(Point, Point) Operator
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Compares two Point structures for equality.
public:
static bool operator ==(System::Windows::Point point1, System::Windows::Point point2);
public static bool operator == (System.Windows.Point point1, System.Windows.Point point2);
static member ( = ) : System.Windows.Point * System.Windows.Point -> bool
Public Shared Operator == (point1 As Point, point2 As Point) As Boolean
Parameters
Returns
true
if both the X and Y coordinates of point1
and point2
are equal; otherwise, false
.
Examples
The following example shows how to check if two Point structures are equal using the overloaded (==) operator.
private Boolean overloadedEqualityOperatorExample()
{
Point point1 = new Point(10, 5);
Point point2 = new Point(15, 40);
// Check if two Points are equal using the overloaded equality operator.
// areEqual is False.
Boolean areEqual = (point1 == point2);
return areEqual;
}
Private Function overloadedEqualityOperatorExample() As Boolean
Dim point1 As New Point(10, 5)
Dim point2 As New Point(15, 40)
' Check if two Points are equal using the overloaded equality operator.
' areEqual is False.
Dim areEqual As Boolean = (point1 = point2)
Return areEqual
End Function
Remarks
A point's coordinates are described using Double values. Because the value of Double can lose precision when arithmetic operations are performed on them, a comparison between two Point values that are logically equal might fail.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기