Cursor.Show Methode

Definition

Zeigt den Cursor an.

public:
 static void Show();
public static void Show ();
static member Show : unit -> unit
Public Shared Sub Show ()

Beispiele

Im folgenden Codebeispiel wird der Cursor ausgeblendet, wenn der Mauszeiger den Clientbereich der Schaltfläche eingibt. Ebenso wird der Cursor erneut angezeigt, wenn der Mauszeiger den Clientbereich der Schaltfläche verlässt. In diesem Beispiel ist eine Form mit einem Button benannten Namen myButtonerforderlich.

private:
   void myButton_MouseEnter( Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      // Hide the cursor when the mouse pointer enters the button.
      ::Cursor::Hide();
   }

   void myButton_MouseLeave( Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      // Show the cursor when the mouse pointer leaves the button.
      ::Cursor::Show();
   }
private void myButton_MouseEnter(object sender, System.EventArgs e)
{
   // Hide the cursor when the mouse pointer enters the button.
   Cursor.Hide();
}

private void myButton_MouseLeave(object sender, System.EventArgs e)
{
   // Show the cursor when the mouse pointer leaves the button.
   Cursor.Show();
}
Private Sub myButton_MouseEnter(sender As Object, e As System.EventArgs) Handles myButton.MouseEnter
   ' Hide the cursor when the mouse pointer enters the button.
   Cursor.Hide()
End Sub
      
      
Private Sub myButton_MouseLeave(sender As Object, e As System.EventArgs) Handles myButton.MouseLeave
   ' Show the cursor when the mouse pointer leaves the button.
   Cursor.Show()
End Sub

Hinweise

Die Show Aufrufe und Hide Methodenaufrufe müssen ausgeglichen sein. Für jeden Aufruf der Hide Methode muss ein entsprechender Aufruf der Show Methode vorhanden sein.

Gilt für

Siehe auch