Cursor.Equals(Object) Método

Definición

Devuelve un valor que indica si este cursor es igual que el Cursor especificado.

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

Parámetros

obj
Object

Cursor que se va comparar.

Devoluciones

Boolean

Es true si este cursor es igual al Cursor especificado; en caso contrario, es false.

Ejemplos

En el ejemplo de código siguiente se crea un cursor a partir de Handle, Current cambia su posición y rectángulo de recorte. El resultado es que el cursor se moverá hacia arriba y hacia la izquierda de 50 píxeles desde donde se ejecuta el código. Además, el rectángulo de recorte del cursor se cambia a los límites del formulario (de forma predeterminada es la pantalla completa del usuario). En este ejemplo se requiere un Form elemento y para Button llamar a este código cuando se hace clic en él.

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

Se aplica a