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.
Ruft die Begrenzungen ab, die das Auswahlrechteck für den Cursor darstellen, oder legt diese fest.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)
Syntax
'Declaration
Public Shared Property Clip As Rectangle
'Usage
Dim value As Rectangle
value = Cursor.Clip
Cursor.Clip = value
public static Rectangle Clip { get; set; }
public:
static property Rectangle Clip {
Rectangle get ();
void set (Rectangle value);
}
/** @property */
public static Rectangle get_Clip ()
/** @property */
public static void set_Clip (Rectangle value)
public static function get Clip () : Rectangle
public static function set Clip (value : Rectangle)
Eigenschaftenwert
Das Rectangle in Bildschirmkoordinaten, das das Auswahlrechteck für den Cursor darstellt.
Hinweise
Ein eingegrenzter Cursor kann sich nur innerhalb des Auswahlrechtecks bewegen. Das System lässt dies i. A. nur zu, wenn Mausaktionen gerade erfasst werden. Wenn der Cursor derzeit nicht eingegrenzt ist, umfasst das resultierende Rechteck die Abmessungen des gesamten Bildschirms.
Beispiel
Im folgenden Codebeispiel 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 links verschoben wird. Außerdem wird das Cursorauswahlrechteck auf die Grenzen des Formulars geändert (in der Standardeinstellung ist dies der gesamte Benutzerbildschirm). Für dieses Beispiel müssen ein Form und ein Button vorhanden sein, der beim Klicken diesen Code aufruft.
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
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);
}
}
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 = 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()
{
// 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.get_Cursor().Equals(Cursors.get_Default()))) {
this.set_Cursor(new Cursor(get_Cursor().get_Current().
get_Handle()));
Cursor.set_Position(new Point(get_Cursor().get_Position().
get_X() - 50, get_Cursor().get_Position().get_Y() - 50));
get_Cursor().set_Clip(new Rectangle(this.get_Location(),
this.get_Size()));
}
} //MoveCursor
.NET Framework-Sicherheit
- UIPermission für alle Fenster zum Festlegen dieser Eigenschaft. Zugeordnete Enumeration: UIPermissionWindow.AllWindows
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0