StylusPoint.Equality(StylusPoint, StylusPoint) 運算子
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
比較兩個指定的 StylusPoint 物體,並判斷它們是否相等。
public:
static bool operator ==(System::Windows::Input::StylusPoint stylusPoint1, System::Windows::Input::StylusPoint stylusPoint2);
public static bool operator ==(System.Windows.Input.StylusPoint stylusPoint1, System.Windows.Input.StylusPoint stylusPoint2);
static member ( = ) : System.Windows.Input.StylusPoint * System.Windows.Input.StylusPoint -> bool
Public Shared Operator == (stylusPoint1 As StylusPoint, stylusPoint2 As StylusPoint) As Boolean
參數
- stylusPoint1
- StylusPoint
這是第一個 StylusPoint 比較的。
- stylusPoint2
- StylusPoint
第二個 StylusPoint 是比較用來比較的。
傳回
true 若 StylusPoint 物件相等;否則, false。
範例
以下範例檢查兩個 StylusPoint 物件是否相等。 由於 X、 Y和 PressureFactor 屬性 point1point2 與 屬性設定為相同值,因此「兩個 StylusPoint 物件相等。」訊息出現了。
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;
Dim point1 As New StylusPoint()
Dim point2 As New StylusPoint()
point1.X = 150
point1.Y = 400
point1.PressureFactor = 0.45F
point2.X = 150
point2.Y = 400
point2.PressureFactor = 0.45F
if (point1 == point2)
{
MessageBox.Show("The two StylusPoint objects are equal.");
}
else
{
MessageBox.Show("The two StylusPoint objects are not equal.");
}
If point1 = point2 Then
MessageBox.Show("The two StylusPoint objects are equal.")
Else
MessageBox.Show("The two StylusPoint objects are not equal.")
End If
備註
此運算子的等價方法為 StylusPoint.Equals(StylusPoint, StylusPoint)