Loading cursor resources dont work

  • Thread starter Thread starter Janice Browns
  • Start date Start date
J

Janice Browns

I have difficulties trying to load a cursor from a resource file.
Using VS 2003 -- opening a new vanilla C# windows form, adding a new vanilla
cursor file -- setting Build Action to 'Embedded Resource'.

In my code I use:
this.Cursor = new Cursor(GetType(),
"WindowsApplication1.Cursor1.cur");

and I get a Null Exception.

If I create a cursor with the file itself (not embedded resource) it work
ok.

I tried tweaking whatever I could -- but could not make it work.
btw - i have no problem reading bitmap resources, but I cant make cursors
resource work.

Any idea?

Thank you very much,

Janice.
 
Janice, did anyone answer you on this one? I have the same problem. If you
solved it yourself could you post the solution please?
Thanks,
Ronnie
 
I've answered my own question.
The Cursor constructor takes a name which is case dependent.
So the following works for my specific filename:
m_curSpot = new Cursor(GetType(),@"spot.CUR");
but this doesn't:
m_curSpot = new Cursor(GetType(),@"spot.cur");
 
Ronnie -- thanks a lot.
In my case this was not because of lower case and upper case, but once I put
the @ sign in fron on the cursor name, it worked.

Go figure....
 
Back
Top