PointF.Inequality(PointF, PointF) 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.
Determines whether the coordinates of the specified points are not equal.
public:
static bool operator !=(System::Drawing::PointF left, System::Drawing::PointF right);
public static bool operator != (System.Drawing.PointF left, System.Drawing.PointF right);
static member op_Inequality : System.Drawing.PointF * System.Drawing.PointF -> bool
Public Shared Operator != (left As PointF, right As PointF) As Boolean
Parameters
Returns
true
to indicate the X and Y values of left
and right
are not equal; otherwise, false
.
Examples
The following code example demonstrates how to use the 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);
}
Private Sub AddExample(ByVal e As PaintEventArgs)
Dim size1 As New SizeF(120.5F, 30.5F)
Dim point1 As New PointF(20.5F, 20F)
Dim rect1 As New RectangleF(point1, size1)
Dim point2 As New PointF(rect1.Right, rect1.Bottom)
If point2 <> PointF.Add(point1, size1) Then
e.Graphics.DrawString("They are not equal", Me.Font, Brushes.Red, rect1)
Else
e.Graphics.DrawString("They are equal", Me.Font, Brushes.Black, rect1)
End If
End Sub
Applies to
Σχόλια
https://aka.ms/ContentUserFeedback.
Σύντομα διαθέσιμα: Καθ' όλη τη διάρκεια του 2024 θα καταργήσουμε σταδιακά τα ζητήματα GitHub ως μηχανισμό ανάδρασης για το περιεχόμενο και θα το αντικαταστήσουμε με ένα νέο σύστημα ανάδρασης. Για περισσότερες πληροφορίες, ανατρέξτε στο θέμα:Υποβολή και προβολή σχολίων για