Tuesday, April 5, 2011

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

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

Any ideas?

From stackoverflow
  • I knew this was a stupid question! Simply put

    Cursor.Hide();
    

    is all I needed in the forms constructor.

    aku : are you sure about "this.Cursor" AFAIK you should use static Cursor class i.e. Cursor.Hide()
    TK : You are correct ... a typo on my part it should be 'Cursor.Hide();' without the this.

0 comments:

Post a Comment