Cursor.Show Metoda

Definice

Zobrazí kurzor.

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

Příklady

Následující příklad kódu skryje kurzor, když ukazatel myši přejde do klientské oblasti tlačítka. Podobně když ukazatel myši opustí oblast klienta tlačítka, kurzor se znovu zobrazí. Tento příklad vyžaduje Form s Button názvem 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

Poznámky

Volání Show a Hide metody musí být vyvážená. Pro každé volání Hide metody musí existovat odpovídající volání Show metody.

Platí pro

Viz také