Cursor.Clip Eigenschaft

Definition

Ruft die Grenzen ab, die das Beschneidungsrechteck für den Cursor darstellen, oder legt diese fest.

public:
 static property System::Drawing::Rectangle Clip { System::Drawing::Rectangle get(); void set(System::Drawing::Rectangle value); };
public static System.Drawing.Rectangle Clip { get; set; }
static member Clip : System.Drawing.Rectangle with get, set
Public Shared Property Clip As Rectangle

Eigenschaftswert

Dies Rectangle stellt das Beschneidungsrechteck für das CursorAusschneidungsrechteck in Bildschirmkoordinaten dar.

Beispiele

Im folgenden Codebeispiel wird ein Cursor aus dem Current Cursor Handleerstellt, dessen Position und das Beschneidungsrechteck geändert. Das Ergebnis ist, dass der Cursor nach oben und nach links 50 Pixel bewegt wird, von wo aus der Code ausgeführt wird. Darüber hinaus wird das Beschneidungsrechteck des Cursors in die Grenzen des Formulars geändert (standardmäßig ist es der gesamte Bildschirm des Benutzers). In diesem Beispiel müssen Sie beim Klicken auf diesen Code einen Form und einen Button Code aufrufen.

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

Hinweise

Ein beschnittener Cursor darf nur innerhalb des Beschneidungsrechtecks verschoben werden. Im Allgemeinen lässt das System dies nur zu, wenn die Maus derzeit erfasst wird. Wenn der Cursor zurzeit nicht abgeschnitten ist, enthält das resultierende Rechteck die Abmessungen des gesamten Bildschirms.

Gilt für: