Search code examples
c#mouse-cursor.net-1.1

How can I change the mouse cursor image?


I need to change the cursor image. Whenever the mouse is over my form I need to load my own image from a local path. I am using version 1.1 of the .NET framwork.

Here is what I have tried:

Cursor = new Cursor(GetType(),  Application.StartupPath+ "\\windowfi.cur");

But this throws an exception:

Value cannot be null.
Parameter name: dataStream


Solution

  • Cursor class has a constructor that takes in cur file path as a parameter. Use that. Like this:

    this.Cursor = new Cursor("<your_cur_file_path");