By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,784 Members | 1,182 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,784 IT Pros & Developers. It's quick & easy.

Embed a Custom Cursor?

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

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

What if you are compiling with the IDE? I don't see a 'command line
options' field anywhere...???
Mar 17 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
VJ
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
"bern11" <be****@yahoo.comwrote in message
news:g7******************************@comcast.com. ..
How do you embed a custom cursor? The help says:

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

What if you are compiling with the IDE? I don't see a 'command line
options' field anywhere...???

Mar 17 '07 #2

P: n/a

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.

VJ wrote:
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
"bern11" <be****@yahoo.comwrote in message
news:g7******************************@comcast.com. ..
>>How do you embed a custom cursor? The help says:

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

What if you are compiling with the IDE? I don't see a 'command line
options' field anywhere...???


Mar 17 '07 #3

P: n/a
VJ
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(name space1.namespace2.class1)).GetManifestResourceStre am("namespace1.class1.AboutImage.GIF");
picturebox1.Image = Image.FromStream(picBkg2);
VJ

Namspace.
"bern11" <be****@yahoo.comwrote in message
news:-N******************************@comcast.com...
>
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.

VJ wrote:
>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
"bern11" <be****@yahoo.comwrote in message
news:g7******************************@comcast.com ...
>>>How do you embed a custom cursor? The help says:

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

What if you are compiling with the IDE? I don't see a 'command line
options' field anywhere...???

Mar 17 '07 #4

P: n/a

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.
VJ wrote:
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(name space1.namespace2.class1)).GetManifestResourceStre am("namespace1.class1.AboutImage.GIF");
picturebox1.Image = Image.FromStream(picBkg2);
VJ

Namspace.
"bern11" <be****@yahoo.comwrote in message
news:-N******************************@comcast.com...
>>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.

VJ wrote:
>>>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
"bern11" <be****@yahoo.comwrote in message
news:g7******************************@comcast.c om...
How do you embed a custom cursor? The help says:

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

What if you are compiling with the IDE? I don't see a 'command line
options' field anywhere...???

Mar 17 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.