This topic has not yet been rated - Rate this topic

Cursor.Hide Method

Hides the cursor.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)
public static void Hide()

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.

The following code 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 requires a Form with a Button named myButton.


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();
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
  • UIPermission  

    for all windows call this method. Associated enumeration: UIPermissionWindow.AllWindows

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
typo?
Under .NET Framework Security, it says:

UIPermission
for all windows call this method....

This should probably read :
"...for all windows which call this method...."?