Cursor.Show Metodo

Definizione

Visualizza il cursore.

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

Esempio

Nell'esempio di codice seguente viene nascosto il cursore quando il puntatore del mouse entra nell'area client del pulsante. Analogamente, quando il puntatore del mouse lascia l'area client del pulsante, viene visualizzato di nuovo il cursore. Questo esempio richiede un Form oggetto con un Button oggetto denominato myButton.

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

Commenti

Le Show chiamate al metodo e Hide devono essere bilanciate. Per ogni chiamata al Hide metodo deve essere presente una chiamata corrispondente al Show metodo.

Si applica a

Vedi anche