Cursor.Show 메서드

정의

커서를 표시합니다.

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

예제

다음 코드 예제에서는 마우스 포인터가 단추의 클라이언트 영역에 들어갈 때 커서를 숨깁니다. 마찬가지로 마우스 포인터가 단추의 클라이언트 영역을 벗어나면 커서가 다시 표시됩니다. 이 예제에는 명명myButtonForm 자가 Button 필요합니다.

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

설명

Hide 메서드 호출은 Show 균형을 유지해야 합니다. 메서드를 호출할 Hide 때마다 메서드에 대한 해당 호출이 Show 있어야 합니다.

적용 대상

추가 정보