Cursor.Equals(Object) Cursor.Equals(Object) Cursor.Equals(Object) Cursor.Equals(Object) Method

定義

このカーソルが、指定した Cursor に等しいかどうかを示す値を返します。Returns a value indicating whether this cursor is equal to the specified Cursor.

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

パラメーター

obj
Object Object Object Object

比較対象の CursorThe Cursor to compare.

戻り値

カーソルが、指定した Cursor に等しい場合は true。それ以外の場合は falsetrue if this cursor is equal to the specified Cursor; otherwise, false.

次のコード例からカーソルを作成する、CurrentカーソルのHandle、その位置とクリッピング四角形を変更します。The following code example creates a cursor from the Current cursor's Handle, changes its position and clipping rectangle. 結果を上から、コードが実行されるが左側の 50 ピクセルにカーソルが移動されます。The result is the cursor will move up and to the left 50 pixels from where it is when the code is executed. さらに、カーソルのクリッピング四角形をフォームの範囲を変更 (既定では、ユーザーの画面全体)。Additionally, the cursor's clipping rectangle is changed to the bounds of the form (by default it is the user's whole screen). この例は、FormButtonがクリックされたときに、このコードを呼び出す。This example requires a Form and a Button to call this code when it is clicked.

void MoveCursor()
{
   // Set the Current cursor, move the cursor's Position,
   // and set its clipping rectangle to the form.

   this->Cursor = gcnew System::Windows::Forms::Cursor( ::Cursor::Current->Handle );
   ::Cursor::Position = Point(::Cursor::Position.X - 50,::Cursor::Position.Y - 50);
   ::Cursor::Clip = Rectangle(this->Location,this->Size);

}
private void MoveCursor()
{
   // Set the Current cursor, move the cursor's Position,
   // and set its clipping rectangle to the form. 

   this.Cursor = new Cursor(Cursor.Current.Handle);
   Cursor.Position = new Point(Cursor.Position.X - 50, Cursor.Position.Y - 50);
   Cursor.Clip = new Rectangle(this.Location, this.Size);
}
Private Sub MoveCursor()
   ' Set the Current cursor, move the cursor's Position,
   ' and set its clipping rectangle to the form. 

   Me.Cursor = New Cursor(Cursor.Current.Handle)
   Cursor.Position = New Point(Cursor.Position.X - 50, Cursor.Position.Y - 50)
   Cursor.Clip = New Rectangle(Me.Location, Me.Size)
End Sub

適用対象