473,324 Members | 1,646 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,324 software developers and data experts.

Changing the cursor

Dom
I need to change the cursor when the mouse is hovering over certain
cells in a DataViewGrid, as a visual aid for the user. But the cursor
is not something found in the Cursors Class. I have a .ICO file.

What is the most efficient way of doing this? Is a way to build the
cursor resource right into the executable, so that it travels with
the EXE? That seems to be the way other programs do it. For example,
I have a resource viewer that lets me see all the resources in Excel,
and I can find Icons, Cursors, etc.

Right now, what I do is this. In the load event of the main window, I
do m_AlternateCursor = new Cursor (<AppStartupPath>\filename), and I
plan to include the ICO file in the executable folder.
Dec 31 '07 #1
2 2335
Dom,

That's what I would do. You wouldn't have to worry about the file being
changed or deleted (of course, it means you have to recompile if the cursor
changes).

You can just add the file to your project and set the compile action to
"embedded resource" and then you would call the GetManifestResourceStream
method on the Assembly class (the instance would represent the assembly you
are getting the embedded resource from). You could then pass that Stream to
the Cursor class, and use it appropriately.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dom" <do********@gmail.comwrote in message
news:4b**********************************@p69g2000 hsa.googlegroups.com...
>I need to change the cursor when the mouse is hovering over certain
cells in a DataViewGrid, as a visual aid for the user. But the cursor
is not something found in the Cursors Class. I have a .ICO file.

What is the most efficient way of doing this? Is a way to build the
cursor resource right into the executable, so that it travels with
the EXE? That seems to be the way other programs do it. For example,
I have a resource viewer that lets me see all the resources in Excel,
and I can find Icons, Cursors, etc.

Right now, what I do is this. In the load event of the main window, I
do m_AlternateCursor = new Cursor (<AppStartupPath>\filename), and I
plan to include the ICO file in the executable folder.

Dec 31 '07 #2
On Mon, 31 Dec 2007 09:46:09 -0800, Dom <do********@gmail.comwrote:
I need to change the cursor when the mouse is hovering over certain
cells in a DataViewGrid, as a visual aid for the user. But the cursor
is not something found in the Cursors Class. I have a .ICO file.

What is the most efficient way of doing this? Is a way to build the
cursor resource right into the executable, so that it travels with
the EXE?
Yes, just add a new Icon resource to the Resources of your project, using
the .ico file you have as the input.

You can then reference the icon from the Properties.Resources class of
your project.

I do agree that this is better than trying to include a separate file in
the same directory with your .exe, though assuming you're using a normal
Setup program to install the program, it shouldn't matter much which way
you do it since the user should never have to care about copying the files
manually.

Pete
Dec 31 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Videos 4 Sale | last post by:
Would you know how to change the look of a mouse pointer on a web page. On the page I have the mouse pointer is exactly as I have at work.... white. But what I want to do is change the look of it...
3
by: Geoff Soper | last post by:
I'm trying to dynamically change the cursor of a couple of maps over an image. Basically the image is in an online photo system where there is a rotate mode. In this mode clicking on the left or...
2
by: malbanese | last post by:
I am building an ASP.Net application that occasionaly "stalls" while running a server side process like a large database update. During this tine the user does not get any feedback as to what is...
3
by: Tim | last post by:
Hi, How would I go about changing the windows mouse cursor ? (Not the mouse cursor on a form...but the actual mouse cursor in windows..) Any ideas would be greatly appreciated Thanks, Tim
2
by: Dave | last post by:
Is there a way to enlarge the text cursor? We need to make it a bit wider to improve visibility and we cannot find any information about this. Many, MANY thanks in advance!
5
by: Craig G | last post by:
how do you change the cursor in Asp.Net? in windows app's i just used me.Cursor = Cursors.WaitCursor but it aint available in ASP.net
2
by: Jim Frazer | last post by:
Hi, I'm working on an application in C# that will allow the user to create simple CAD drawings on a CEPC system. I would like to be able to change the cursor shape depending on the drawing mode...
5
by: mcraven.2 | last post by:
I know this works on all objects except drop down boxes. doc = document.all for (i=0;i<doc.length;i++) { doc(i).style.cursor = 'wait'; } Is it possible to make a cursor into an hourglass...
3
by: fbergroth | last post by:
Hi, I'm quite new to C# allthough I've been programming in other languages for quite a while. I'd like to change the blinking cursor inside a TextBox, I guess I must derive the class and...
0
by: IanWright | last post by:
I'm trying to change the cursor that appears on a standard ListView when the cursor appears over an item. However I am getting a flickering effect as the mouse is changed to a finger cursor, and then...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.