468,294 Members | 1,945 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,294 developers. It's quick & easy.

Embed a Custom Cursor?

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
4 3291
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

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
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

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.

Similar topics

3 posts views Thread by Simon Wigzell | last post: by
2 posts views Thread by Brad | last post: by
1 post views Thread by Tim | last post: by
reply views Thread by Andy Wynn | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.