473,320 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 3498
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tom Alcendor | last post by:
I am building a chess game application that allows a user to click on a piece and move it to a new square. When the user clicks on a piece the mouse pointer must change to the image associated...
3
by: Simon Wigzell | last post by:
I have an image with several links in it in mapped areas. I am using a custom cursor on the page and would like to have a custom cursor appear on mouse over of the mapped links. Something like: ...
3
by: M | last post by:
Hi Folks, Does anyone know how to embed a file into a resource in C#? You seem to be able to embed Icon, Bitmap, Cursor's & Strings. But how do you embed a file??? In VC++ version 6 you...
4
by: BBFrost | last post by:
We have a data entry application written within Framework 1.0 that contains 20+ custom user controls. The controls overlay each other so that only one custom control is visible at a time. What...
2
by: Brad | last post by:
Hi all, newbie here. I'm currently designing a custom splitter control... When the mouse hovers over a certain area on my splitter I need to be able to display a custom cursor that I've designed....
1
by: Tim | last post by:
Hi, I would like to create a custom mouse cursor for my print preview page. I want to use a bitmap of a magnifiying glass with a plus in it. Pretty standard stuff. How do I change the cursor?...
6
by: Peter Oliphant | last post by:
I've now asked how three times in this forum with no answers. So I went to the 'windowsforms' newsgroup, and found this post, also unanswered, with the same problem: "Hello, I've tried to...
6
by: Erick | last post by:
I've created a class called Procs and a collection class called Processes which uses a hastable object to store the Procs. Now i want to enumerate with the "For each" to extract all the Procs in...
0
by: Andy Wynn | last post by:
Hello All, I've got a custom control ( Panel-like, but not inheriting from Panel) that has a header region that's custom drawn. Custom Control is using a custom controldesigner class that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.