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

Problems Changing Mouse Cursor Type

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 selected by the user. I started
out by setting up P/Invokes for LoadCursor and SetCursor. Calling
LoadCursor followed by SetCursor does allow me to change to a different
cursor, such as the cross cursor, but as soon as the application leaves the
function in which I make the change, the cursor reverts back to the standard
arrow cursor. I tried a simple test that changed the cursor to the wait
cursor via:

Cursor.Current = Cursors.WaitCursor;

The same behavior occurs. The cursor changes, but reverts to the arrow as
soon as I leave the function where the change was made. I've searched the
archives for this newsgroup but couldn't find anything that would help me.
I'm open to ideas. I'm fluent in C++ dll writing if that would be useful.

Thanks,

Jim Frazer

Mar 20 '06 #1
2 8992
Jim,

AFAIK you can only set the cursor for a single window. So as you explained,
as soon as you move away from the calling window where the cursor was
changed the cursor changes back to the application default, which is the
pointer.

However, if i am wrong i am sure someone would point this out.

BTW have you tried changing the cursor of the main winform in your
application to see if this has the desired effect.

Regards
Scott Blood
C# Developer
"Jim Frazer" <ji*@nospam.net> wrote in message
news:uD**************@TK2MSFTNGP09.phx.gbl...
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 selected by the user. I
started
out by setting up P/Invokes for LoadCursor and SetCursor. Calling
LoadCursor followed by SetCursor does allow me to change to a different
cursor, such as the cross cursor, but as soon as the application leaves
the
function in which I make the change, the cursor reverts back to the
standard
arrow cursor. I tried a simple test that changed the cursor to the wait
cursor via:

Cursor.Current = Cursors.WaitCursor;

The same behavior occurs. The cursor changes, but reverts to the arrow as
soon as I leave the function where the change was made. I've searched the
archives for this newsgroup but couldn't find anything that would help me.
I'm open to ideas. I'm fluent in C++ dll writing if that would be useful.

Thanks,

Jim Frazer

Mar 20 '06 #2
Hi Scott,

I tried changing the cursor in the Form_Load event to no avail. Perhaps
there's a better place than that.

I have a custom control for the drawing area and I would be happy if I could
change the cursor to a desired shape whenever the cursor is in the drawing
area. At the moment, I'm looking at other ways to notify the user that
he/she's in a special drawing mode. Changing cursor shape would be a great
way to do this since that's where the person's eyes are focused.

Thanks for responding.

Jim

"scott blood" <sc*********@hotmail.com> wrote in message
news:O3**************@tk2msftngp13.phx.gbl...
Jim,

AFAIK you can only set the cursor for a single window. So as you
explained, as soon as you move away from the calling window where the
cursor was changed the cursor changes back to the application default,
which is the pointer.

However, if i am wrong i am sure someone would point this out.

BTW have you tried changing the cursor of the main winform in your
application to see if this has the desired effect.

Regards
Scott Blood
C# Developer
"Jim Frazer" <ji*@nospam.net> wrote in message
news:uD**************@TK2MSFTNGP09.phx.gbl...
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 selected by the user. I
started
out by setting up P/Invokes for LoadCursor and SetCursor. Calling
LoadCursor followed by SetCursor does allow me to change to a different
cursor, such as the cross cursor, but as soon as the application leaves
the
function in which I make the change, the cursor reverts back to the
standard
arrow cursor. I tried a simple test that changed the cursor to the wait
cursor via:

Cursor.Current = Cursors.WaitCursor;

The same behavior occurs. The cursor changes, but reverts to the arrow
as
soon as I leave the function where the change was made. I've searched
the
archives for this newsgroup but couldn't find anything that would help
me.
I'm open to ideas. I'm fluent in C++ dll writing if that would be
useful.

Thanks,

Jim Frazer


Mar 20 '06 #3

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

Similar topics

2
by: Robin Shuff | last post by:
Hi, I'm trying to limit the movement of the mouse cursor in using a VB app. The idea is to stop the cursor straying on to the second monitor of a dual screen set-up (i.e. a projector) while this...
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...
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
3
by: jcrouse | last post by:
I have created a form designer type application (with a lot of you peoples helpJ). It has label controls that are draggable at runtime. The user is also allowed to change some properties such as...
1
by: Andy Baxter | last post by:
hello, I'm writing a panoramic image viewer in javascript. When the mouse is over the image, I want it to be a crosshair (over most of the image), or a hand/pointer (when it's over an image map...
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...
5
by: Mudcat | last post by:
I was trying to design a widget that I could drag and drop anywhere in a frame and then resize by pulling at the edges with the mouse. I have fiddled with several different approaches and came...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.