Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Gibt einen Wert zurück, der angibt, ob dieser Cursor mit dem angegebenen Cursor übereinstimmt.
Overrides Public Function Equals( _
ByVal obj As Object _) As Boolean
[C#]
public override bool Equals(objectobj);
[C++]
public: bool Equals(Object* obj);
[JScript]
public override function Equals(
obj : Object) : Boolean;
Parameter
- obj
Der zu vergleichende Cursor.
Rückgabewert
true, wenn dieser Cursor dem angegebenen Cursor entspricht, andernfalls false.
Beispiel
[Visual Basic, C#, C++] Im folgenden Beispiel wird ein Cursor aus dem Handle des Current-Cursors erstellt und dessen Position sowie das Auswahlrechteck geändert. Dies führt dazu, dass der Cursor von der ursprünglichen Position vor der Ausführung des Codes um 50 Pixel nach oben und nach rechts verschoben wird. Außerdem wird das Cursorauswahlrechteck auf die Grenzen des Formulars geändert (in der Standardeinstellung ist dies der gesamte Benutzerbildschirm). Im Beispiel wird davon ausgegangen, dass ein Form und ein Button, der beim Klicken diesen Code aufruft, vorhanden sind.
Private Sub MoveCursor()
' If the form's cursor is not the Default cursor,
' set the Current cursor, move the cursor's Position,
' and set its clipping rectangle to the form.
If Not Me.Cursor.Equals(Cursors.Default) Then
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 If
End Sub
[C#]
private void MoveCursor()
{
// If the form's cursor is not the Default cursor,
// set the Current cursor, move the cursor's Position,
// and set its clipping rectangle to the form.
if(!this.Cursor.Equals(Cursors.Default))
{
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);
}
}
[C++]
private:
void MoveCursor() {
// If the form's cursor is not the Default cursor,
// set the Current cursor, move the cursor's Position,
// and set its clipping rectangle to the form.
if (!this->Cursor->Equals(Cursors::Default)) {
this->Cursor = new 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);
}
}
[JScript] Für JScript ist kein Beispiel verfügbar. Klicken Sie zum Anzeigen eines Beispiels für Visual Basic, C# oder C++ in der linken oberen Ecke der Seite auf die Schaltfläche "Sprachfilter"
.
Anforderungen
Plattformen: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003-Familie, .NET Compact Framework - Windows CE .NET
Siehe auch
Cursor-Klasse | Cursor-Member | System.Windows.Forms-Namespace | Ungleichheitsoperator | Gleichheitsoperator