This documentation is archived and is not being maintained.

PointF.op_Inequality Method

Determines whether the coordinates of the specified points are not equal.

Namespace: System.Drawing
Assembly: System.Drawing (in system.drawing.dll)

public static bool operator != (
	PointF left,
	PointF right
)
Not applicable.

Parameters

left

A PointF to compare.

right

A PointF to compare.

Return Value

true to indicate the X and Y values of left and right are not equal; otherwise, false.

The following code example demonstrates how to use the op_Inequality operator. To run this example, paste the following code into a Windows Form. Handle the form's Paint event and call AddExample, passing e as PaintEventArgs.

private void AddExample(PaintEventArgs e)
{
    PointF point1 = new PointF(120.5F, 120F);
    SizeF size1 = new SizeF(20.5F, 20.5F);
    RectangleF rect1 = new RectangleF(point1, size1);
    PointF point2 = new PointF(rect1.Right, rect1.Bottom);
    if (point2 != PointF.Add(point1, size1))
        e.Graphics.DrawString("They are not equal", this.Font, Brushes.Red, rect1);
    else
        e.Graphics.DrawString("They are equal", this.Font, Brushes.Black, rect1);

}

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, 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, 2.0, 1.1, 1.0
Show: