Embed a Custom Cursor?

  • Thread starter Thread starter bern11
  • Start date Start date
B

bern11

How do you embed a custom cursor? The help says:

// On the command line:
// Add the following flag:
// /res:CursorFileName.Cur,Namespace.CursorFileName.Cur

What if you are compiling with the IDE? I don't see a 'command line
options' field anywhere...???
 
IDE you will include the file in the project and there is a property
available in the property window called "Build Action", when you select the
file. Set that to "Embedded Resource"

VJ
 
I have the build options to 'Embedded Resource', it still does not
work. Every time it reaches the cursor statement, I get a "Object
reference not set to an instance of an object." error. This is my
statement:

Cursor myCurdor;
myCursor = new Cursor(GetType(), "Cursor1.cur");

"Cursor1.cur" is a cursor file added to the project with "Embedded
Resource" selected. I've tried screwing aorund with 'custom tool
namespace', but it doesn't seem to matter.
 
Ahh ok that is the second part it has to be fully qualified name, like
something below should get you started. AboutImage.gif is a embbed resource
for us.

System.IO.Stream picBkg2 =
System.Reflection.Assembly.GetAssembly(typeof(namespace1.namespace2.class1)).GetManifestResourceStream("namespace1.class1.AboutImage.GIF");
picturebox1.Image = Image.FromStream(picBkg2);


VJ

Namspace.
 
OK - figured it out. I didn't notice but when I created it, it went
into the 'Properties' folder and hence the 'Properties' subdirectory. I
moved it in the solution manager to off the main project and it works.
Thanks for the help.
 
Back
Top