This documentation is archived and is not being maintained.

Cursor.Show Method

Displays the cursor.

[Visual Basic]
Public Shared Sub Show()
[C#]
public static void Show();
[C++]
public: static void Show();
[JScript]
public static function Show();

Remarks

The Show and Hide method calls must be balanced. For every call to the Hide method there must be a corresponding call to the Show method.

Example

[Visual Basic, C#, C++] The following example hides the cursor when the mouse pointer enters the button's client area. Likewise, when the mouse pointer leaves the button's client area, the cursor is shown again. This example assumes you have a Form with a Button named myButton.

[Visual Basic] 
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 'myButton_MouseEnter
      
      
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 'myButton_MouseLeave
      

[C#] 
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();
}

[C++] 
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();
    }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

Cursor Class | Cursor Members | System.Windows.Forms Namespace | Hide

Show: