Cursor.Show Metoda

Definicja

Wyświetla kursor.

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

Przykłady

Poniższy przykład kodu ukrywa kursor, gdy wskaźnik myszy przechodzi do obszaru klienta przycisku. Podobnie, gdy wskaźnik myszy opuszcza obszar klienta przycisku, kursor jest wyświetlany ponownie. W tym przykładzie jest wymagany element Form Button o nazwie 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

Uwagi

Wywołania Show metod i Hide muszą być zrównoważone. Dla każdego wywołania Hide metody musi istnieć odpowiednie wywołanie Show metody .

Dotyczy

Zobacz też