StylusPoint.Equals 方法

定義

比較兩個 StylusPoint 物件是否相等。

多載

Equals(Object)

傳回值,這個值表示指定的物件是否等於 StylusPoint

Equals(StylusPoint)

傳回布林值,這個值表示指定的 StylusPoint 是否等於目前的 StylusPoint

Equals(StylusPoint, StylusPoint)

傳回布林值,這個值表示兩個指定的 StylusPoint 物件是否相等。

Equals(Object)

傳回值,這個值表示指定的物件是否等於 StylusPoint

public:
 override bool Equals(System::Object ^ o);
public override bool Equals (object o);
override this.Equals : obj -> bool
Public Overrides Function Equals (o As Object) As Boolean

參數

o
Object

要與目前 StylusPoint 比較的 StylusPoint

傳回

如果物件相等則為 true,否則為 false

範例

下列範例會檢查兩個 StylusPoint 物件是否相等。 由於和 上的 Xpoint1point2Y、 和 PressureFactor 屬性都設定為相同的值,所以「兩個 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 (point2.Equals(point1))
{
    MessageBox.Show("The two StylusPoint objects are equal.");
}
else
{
    MessageBox.Show("The two StylusPoint objects are not equal.");
}
If point2.Equals(point1) Then
    MessageBox.Show("The two StylusPoint objects are equal.")
Else
    MessageBox.Show("The two StylusPoint objects are not equal.")
End If

適用於

Equals(StylusPoint)

傳回布林值,這個值表示指定的 StylusPoint 是否等於目前的 StylusPoint

public:
 virtual bool Equals(System::Windows::Input::StylusPoint value);
public bool Equals (System.Windows.Input.StylusPoint value);
override this.Equals : System.Windows.Input.StylusPoint -> bool
Public Function Equals (value As StylusPoint) As Boolean

參數

value
StylusPoint

要與目前 StylusPoint 比較的 StylusPoint

傳回

如果 StylusPoint 物件相等則為 true,否則為 false

實作

範例

下列範例會檢查兩個 StylusPoint 物件是否相等。 由於和 上的 Xpoint1point2Y、 和 PressureFactor 屬性都設定為相同的值,所以「兩個 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 (point2.Equals(point1))
{
    MessageBox.Show("The two StylusPoint objects are equal.");
}
else
{
    MessageBox.Show("The two StylusPoint objects are not equal.");
}
If point2.Equals(point1) Then
    MessageBox.Show("The two StylusPoint objects are equal.")
Else
    MessageBox.Show("The two StylusPoint objects are not equal.")
End If

適用於

Equals(StylusPoint, StylusPoint)

傳回布林值,這個值表示兩個指定的 StylusPoint 物件是否相等。

public:
 static bool Equals(System::Windows::Input::StylusPoint stylusPoint1, System::Windows::Input::StylusPoint stylusPoint2);
public static bool Equals (System.Windows.Input.StylusPoint stylusPoint1, System.Windows.Input.StylusPoint stylusPoint2);
static member Equals : System.Windows.Input.StylusPoint * System.Windows.Input.StylusPoint -> bool
Public Shared Function Equals (stylusPoint1 As StylusPoint, stylusPoint2 As StylusPoint) As Boolean

參數

stylusPoint1
StylusPoint

要比較的第一個 StylusPoint

stylusPoint2
StylusPoint

要比較的第二個 StylusPoint

傳回

如果 StylusPoint 物件相等則為 true,否則為 false

範例

下列範例會檢查兩個 StylusPoint 物件是否相等。 由於和 上的 Xpoint1point2Y、 和 PressureFactor 屬性都設定為相同的值,所以「兩個 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 (StylusPoint.Equals(point1, point2))
{
    MessageBox.Show("The two StylusPoint objects are equal.");
}
else
{
    MessageBox.Show("The two StylusPoint objects are not equal.");
}
If StylusPoint.Equals(point1, point2) Then
    MessageBox.Show("The two StylusPoint objects are equal.")
Else
    MessageBox.Show("The two StylusPoint objects are not equal.")
End If

適用於