User Tools

Site Tools

한국어

winforms:hide_mouse_cursor:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
winforms:hide_mouse_cursor:index [2026/07/08 02:17] – created mfranklinwinforms:hide_mouse_cursor:index [2026/07/08 02:28] (current) mfranklin
Line 1: Line 1:
-====== WinForms (Linux) Hiding the Mouse Cursor ======+====== Hiding the Pointer Cursor ======
  
-The ComfileTech.WinForms implementation does not support [[https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor.hide|System.Windows.Forms.Cursor.Hide]].  As a workaround, hide the mouse cursor by setting [[https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor|Form.Cursor]] to an invisible cursor.+The ComfileTech.WinForms implementation does not support [[https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor.hide|System.Windows.Forms.Cursor.Hide]].  As a workaround, hide the pointer cursor by setting [[https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor|Form.Cursor]] to an invisible cursor.
  
 <code csharp> <code csharp>
-if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))+public partial class Main : Form
 { {
-    Cursor = Cursors.Invisible;+    public Main() 
 +    { 
 +        if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) 
 +        { 
 +            Cursor = Cursors.Invisible; 
 +        } 
 +    }
 } }
  
Line 13: Line 19:
     private static byte[] Data;     private static byte[] Data;
  
-    // 
-    // Summary: 
-    //     An invisible cursor for use on platforms that do not support the System.Windows.Forms.Cursor.Hide 
-    //     method. 
     public static Cursor Invisible { get; }     public static Cursor Invisible { get; }
  
Line 60: Line 62:
     }     }
 } }
 +
 </code> </code>
winforms/hide_mouse_cursor/index.1783477029.txt.gz · Last modified: by mfranklin