473,395 Members | 2,689 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,395 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 2343
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.