Point.Inequality(Point, Point) Operator
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 inequality.
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 op_Inequality : System.Windows.Point * System.Windows.Point -> bool
Public Shared Operator != (point1 As Point, point2 As Point) As Boolean
- point1
- Point
The first point to compare.
- point2
- Point
The second point to compare.
true
if point1
and point2
have different X or Y coordinates; false
if point1
and point2
have the same X and Y coordinates.
The following example shows how to check whether two Point structures are not equal, using the overloaded (!=) operator.
private Boolean overloadedInequalityOperatorExample()
{
Point point1 = new Point(20, 30);
Point point2 = new Point(45, 70);
// Check whether the two Points are not equal, using the overloaded
// inequality operator.
// areNotEqual is True.
Boolean areNotEqual = (point1 != point2);
return areNotEqual;
}
Private Function overloadedInequalityOperatorExample() As Boolean
Dim point1 As New Point(20, 30)
Dim point2 As New Point(45, 70)
' Check whether the two Points are not equal, using the overloaded
' inequality operator.
' areNotEqual is True.
Dim areNotEqual As Boolean = (point1 <> point2)
Return areNotEqual
End Function
A point's X and Y coordinates are described using Double values. Because Double values can lose precision when operated on, a comparison between two Point values that are logically equal might fail.
제품 | 버전 |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET 피드백
.NET은(는) 오픈 소스 프로젝트입니다. 다음 링크를 선택하여 피드백을 제공해 주세요.