cursor Resources elp

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a user control and i have added .cur cursor files to the project
and trying to set .Cursor to new Cursor(gettype(), "cursorname.cur"); and I
am getting

An unhandled exception of type 'System.ArgumentNullException' occurred in
system.windows.forms.dll

Additional information: Value cannot be null.


Any ideas? The .cur reference is matching case and the .cur is in the
project.

Thanks
 
Make sure it is an embedded resource and make sure that the cursor name
doesnt match a class name

James
 
It is in the property panel as an "embedded resource" and its not matching
the class name.

Still a ARg null error arrr arg argghhh..
 
I believe you're mis-using that constructor. Have you read the docs for
this overload? The first argument is not the containing type, but should be
the type of the resource. My best guess is that you should change it to
something like:
new Cursor( typeof(Cursor), GetType().Namespace + ".cursorname.cur");
 
Back
Top