C# How can I hide the cursor in a winforms app?

14,349

I knew this was a stupid question! Simply put

Cursor.Hide();

is all I needed in the forms constructor.

Share:
14,349

Related videos on Youtube

TK.
Author by

TK.

--

Updated on April 18, 2022

Comments

  • TK.
    TK. about 2 years

    Im developing a touchscreen app and I need to hide the cursor whenever it is within the main Form.

    Any ideas?

  • aku
    aku over 15 years
    are you sure about "this.Cursor" AFAIK you should use static Cursor class i.e. Cursor.Hide()
  • TK.
    TK. over 15 years
    You are correct ... a typo on my part it should be 'Cursor.Hide();' without the this.
  • BrainSlugs83
    BrainSlugs83 over 10 years
    How do you toggle it? Calling the methods outside of the form's constructor don't seem to have any effect. :-/
  • TaW
    TaW almost 7 years
    It should be noted that Cursor.Hide(); and Cursor.Show(); need to be balanced!!!