Cursor.Hide Method
Hides the cursor.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
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(); }
- UIPermission
for all windows call this method. Associated enumeration: UIPermissionWindow.AllWindows
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.