How to change the mouse cursor into a custom one when working with Windows Forms applications?

Bart Gijssens picture Bart Gijssens · Jul 19, 2011 · Viewed 70.3k times · Source

In a UserControl I want to change the mouse cursor from the arrow, to a hand icon.
What I currently do is this:

this.Cursor = Cursors.Hand;

This is very nice, it gives me a mouse cursor looking like this:

enter image description here

But here comes my problem... this shows a hand with a pointing finger.
What I need is a "grabbing" hand, more like this one:

enter image description here

How do I do this?, How can I load an icon file (.ico), a cursor file (.cur), or image file (.png), and use it as the mouse cursor?

Answer

fixagon picture fixagon · Jul 19, 2011

If you have a cursor file:

Cursor myCursor = new Cursor("myCursor.cur");
myControl.Cursor = myCursor;

otherwise you have to create one:

some more information about custom cursors