473,761 Members | 4,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Embed a Custom Cursor?

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

// On the command line:
// Add the following flag:
// /res:CursorFileN ame.Cur,Namespa ce.CursorFileNa me.Cur

What if you are compiling with the IDE? I don't see a 'command line
options' field anywhere...???
Mar 17 '07 #1
4 3544
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.c omwrote 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:CursorFileN ame.Cur,Namespa ce.CursorFileNa me.Cur

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.cu r");

"Cursor1.cu r" 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.c omwrote 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:CursorFileN ame.Cur,Namespa ce.CursorFileNa me.Cur

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.Strea m picBkg2 =
System.Reflecti on.Assembly.Get Assembly(typeof (namespace1.nam espace2.class1) ).GetManifestRe sourceStream("n amespace1.class 1.AboutImage.GI F");
picturebox1.Ima ge = Image.FromStrea m(picBkg2);
VJ

Namspace.
"bern11" <be****@yahoo.c omwrote 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.cu r");

"Cursor1.cu r" 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.c omwrote in message
news:g7******* *************** ********@comcas t.com...
>>>How do you embed a custom cursor? The help says:

// On the command line:
// Add the following flag:
// /res:CursorFileN ame.Cur,Namespa ce.CursorFileNa me.Cur

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.Strea m picBkg2 =
System.Reflecti on.Assembly.Get Assembly(typeof (namespace1.nam espace2.class1) ).GetManifestRe sourceStream("n amespace1.class 1.AboutImage.GI F");
picturebox1.Ima ge = Image.FromStrea m(picBkg2);
VJ

Namspace.
"bern11" <be****@yahoo.c omwrote 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.cu r");

"Cursor1.cu r" 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.c omwrote in message
news:g7***** *************** **********@comc ast.com...
How do you embed a custom cursor? The help says:

// On the command line:
// Add the following flag:
// /res:CursorFileN ame.Cur,Namespa ce.CursorFileNa me.Cur

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
4619
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 with that square. The squares are PictureBoxes with images of the pieces set to the pBox's image property. I am having trouble with changing the mouse pointer to a custom mouse pointer during drag and drop operations. I have checked several...
3
6909
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: This works for the body, font or img tag: <body style="cursor: url('cursor2.cur')"> <font style="cursor: url('cursor1.cur')">Text</font> <img style="cursor: url('cursor1.cur')" src="...etc...">
3
2228
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 would, Find the Resource, Load It, get its size, and then write it out to where ever you want it.
4
2693
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 is the best way to keep the cursor from jumping to another non-visible control when the user tabs past the (currently designated) last control on the form. I've had some luck using the Leave event but the last visible control can change...
2
2422
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. I've tried several ways to assign my custom cursor to a cursor variable, the most obvious being by the filename: myCursor = new Cursor("c:\\myCursor.cur"); and then assign it as the current cursor when in position: Cursor.current = myCursor
1
3932
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? I found the code below but I just get the default mouse cursor dragging around the bitmap which is actually a little behind. I want to replace the
6
5056
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 find something on this in the newsgroups but came up with nada: I'm trying to create a custom cursor in VS2005. I have a .cur file
6
2761
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 my Processes class. As far as i can tell i need to implement an IEnuerator method to do this. But how ? 'Procs Class Public Class Procs Private _Id As Integer
0
1346
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 inherits from ParentControlDesigner. Just for starters I wanted to try to change the mouse cursor if it fell
0
9538
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9975
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9788
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8794
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6623
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5241
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3889
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3481
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2765
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.