StylusPoint.Equals Method

Definition

Compares two StylusPoint objects for equality.

Overloads

Equals(Object)

Returns a value indicating whether the specified object is equal to the StylusPoint.

Equals(StylusPoint)

Returns a Boolean value that indicates whether the specified StylusPoint is equal to the current StylusPoint.

Equals(StylusPoint, StylusPoint)

Returns a Boolean value that indicates whether the two specified StylusPoint objects are equal.

Equals(Object)

Returns a value indicating whether the specified object is equal to the StylusPoint.

C#
public override bool Equals(object o);

Parameters

o
Object

The StylusPoint to compare to the current StylusPoint.

Returns

true if the objects are equal; otherwise, false.

Examples

The following example checks two StylusPoint objects for equality. Because the X, Y, and PressureFactor properties on point1 and point2 are set to the same value, the "The two StylusPoint objects are equal." Message appears.

C#
StylusPoint point1 = new StylusPoint();
StylusPoint point2 = new StylusPoint();

point1.X = 150;
point1.Y = 400;
point1.PressureFactor = 0.45f;

point2.X = 150;
point2.Y = 400;
point2.PressureFactor = 0.45f;
C#
if (point2.Equals(point1))
{
    MessageBox.Show("The two StylusPoint objects are equal.");
}
else
{
    MessageBox.Show("The two StylusPoint objects are not equal.");
}

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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, 10

Equals(StylusPoint)

Returns a Boolean value that indicates whether the specified StylusPoint is equal to the current StylusPoint.

C#
public bool Equals(System.Windows.Input.StylusPoint value);

Parameters

value
StylusPoint

The StylusPoint to compare to the current StylusPoint.

Returns

true if the StylusPoint objects are equal; otherwise, false.

Implements

Examples

The following example checks two StylusPoint objects for equality. Because the X, Y, and PressureFactor properties on point1 and point2 are set to the same value, the "The two StylusPoint objects are equal." Message appears.

C#
StylusPoint point1 = new StylusPoint();
StylusPoint point2 = new StylusPoint();

point1.X = 150;
point1.Y = 400;
point1.PressureFactor = 0.45f;

point2.X = 150;
point2.Y = 400;
point2.PressureFactor = 0.45f;
C#
if (point2.Equals(point1))
{
    MessageBox.Show("The two StylusPoint objects are equal.");
}
else
{
    MessageBox.Show("The two StylusPoint objects are not equal.");
}

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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, 10

Equals(StylusPoint, StylusPoint)

Returns a Boolean value that indicates whether the two specified StylusPoint objects are equal.

C#
public static bool Equals(System.Windows.Input.StylusPoint stylusPoint1, System.Windows.Input.StylusPoint stylusPoint2);

Parameters

stylusPoint1
StylusPoint

The first StylusPoint to compare.

stylusPoint2
StylusPoint

The second StylusPoint to compare.

Returns

true if the StylusPoint objects are equal; otherwise, false.

Examples

The following example checks two StylusPoint objects for equality. Because the X, Y, and PressureFactor properties on point1 and point2 are set to the same value, the "The two StylusPoint objects are equal." Message appears.

C#
StylusPoint point1 = new StylusPoint();
StylusPoint point2 = new StylusPoint();

point1.X = 150;
point1.Y = 400;
point1.PressureFactor = 0.45f;

point2.X = 150;
point2.Y = 400;
point2.PressureFactor = 0.45f;
C#
if (StylusPoint.Equals(point1, point2))
{
    MessageBox.Show("The two StylusPoint objects are equal.");
}
else
{
    MessageBox.Show("The two StylusPoint objects are not equal.");
}

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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, 10