473,503 Members | 3,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reliable way to change the cursor

1) Me.Cursor = Cursors.WaitCursor
This works - except when you hover the mouse over a textbox or datagridview
control, it doesnt show the waitcursor.

2) Me.UseWaitCursor = True
This works if i set it off a button click. It does not work if i set it as
part of a process, which is extremely odd.
One would suspect that would be because im unsetting it somewhere in the
process, but to eliminate this possibility, i did a replace and changed them
to the Me.Cursor method and it worked fine. Of course, its not fine because
of the problems i described in #1.

Anyone else had this issue?

Jun 26 '07 #1
5 2326
"Luke R" <do**@spam.meschrieb
1) Me.Cursor = Cursors.WaitCursor
This works - except when you hover the mouse over a textbox or
datagridview control, it doesnt show the waitcursor.

2) Me.UseWaitCursor = True
This works if i set it off a button click. It does not work if i set
it as part of a process, which is extremely odd.
One would suspect that would be because im unsetting it somewhere in
the process, but to eliminate this possibility, i did a replace and
changed them to the Me.Cursor method and it worked fine. Of course,
its not fine because of the problems i described in #1.

Anyone else had this issue?

Why not use Cursor.Current= Cursors.Waitcursor?
Armin

Jun 27 '07 #2
At first i thought that didnt even work at all, and then i discovered that
it works if you dont touch the mouse... if you move the mouse one pixel in
any direction it goes back to the default cursor for the object the cursor
is over.
"Armin Zingler" <az*******@freenet.dewrote in message
news:Og**************@TK2MSFTNGP05.phx.gbl...
"Luke R" <do**@spam.meschrieb
>1) Me.Cursor = Cursors.WaitCursor
This works - except when you hover the mouse over a textbox or
datagridview control, it doesnt show the waitcursor.

2) Me.UseWaitCursor = True
This works if i set it off a button click. It does not work if i set
it as part of a process, which is extremely odd.
One would suspect that would be because im unsetting it somewhere in
the process, but to eliminate this possibility, i did a replace and
changed them to the Me.Cursor method and it worked fine. Of course,
its not fine because of the problems i described in #1.

Anyone else had this issue?


Why not use Cursor.Current= Cursors.Waitcursor?
Armin
Jun 27 '07 #3
"Luke R" <do**@spam.meschrieb
At first i thought that didnt even work at all, and then i
discovered that it works if you dont touch the mouse... if you move
the mouse one pixel in any direction it goes back to the default
cursor for the object the cursor is over.
Works here. I assumed that the WaitCursor only makes sense if the thread is
busy. Then it should work. If it is not busy, or if you use
Application.Doevents, then it does not work, but then one shouldn't use the
WaitCursor (IMO).
Armin
Jun 27 '07 #4
Am i confused or are you saying that you shouldnt use the WaitCursor if you
are using DoEvents?

It works if the ui thread is locked (i.e. running a process). But what about
if i want to write status messages to the status bar during the process? The
only way to make them display is by calling DoEvents.
This really pisses me off. Why cant things just work the way they say they
do. Especially with something as fundamental as the wait cursor.

UseWaitCursor: "Gets or sets a value indicating whether to use the wait
cursor for the current control and all child controls."

That is false. It simply doesnt work like that.
"Armin Zingler" <az*******@freenet.dewrote in message
news:ed**************@TK2MSFTNGP04.phx.gbl...
"Luke R" <do**@spam.meschrieb
>At first i thought that didnt even work at all, and then i
discovered that it works if you dont touch the mouse... if you move
the mouse one pixel in any direction it goes back to the default
cursor for the object the cursor is over.

Works here. I assumed that the WaitCursor only makes sense if the thread
is
busy. Then it should work. If it is not busy, or if you use
Application.Doevents, then it does not work, but then one shouldn't use
the WaitCursor (IMO).
Armin

Jun 27 '07 #5
"Luke R" <do**@spam.meschrieb
The reason the wait cursor is important is because my application
communicates with the database via a web service. Running operations
on a background process is not always practical, so when I do need
to wait for a web service call to return, I need the cursor to be
the wait cursor. Sometimes I run multiple web service calls in a
row, meaning I need to update status messages along the way. The
only reason I use DoEvents is because I need the status label to
update...

I understand, but the point is: You use Doevents, consequently the user can
use the Forms and Controls. Why do you /still/ want to show a Waitcursor
because the user does /not/ have to wait. If you wanna show that there is
something going on in the background, show it in a label or put an animated
gif on the Form. Though, how do you handle it that the user can even close
the Form while waiting for the web service?

Armin

Jun 29 '07 #6

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

Similar topics

3
17290
by: Csaba2000 | last post by:
I have set onmousedown to change the cursor, but this setting is ignored (IE 5.5; NN 6.1 on Win 2K Pro) until the mouse is either moved or the mouse button is released. On Opera 7.01, the setting...
1
2170
by: Tee | last post by:
Hi, From my main form, I am executing another application using System.Diagnostics.Process.Start. The application has its own window displaying when the applicaiton is run. I want to change...
9
37167
by: Christian Blackburn | last post by:
Hi Gang, In VB6 is was relatively easy to change the pointer, but now I don't even see that as a property for any objects. Can somebody tell me how to do that in .NET? Thanks in Advance,...
4
5162
by: Maria | last post by:
Hello ! I try to change the cursor on the form like this : Me.Cursor = Cursors.WaitCursor 'reading from database 'showing file Me.Cursor = Cursors.Arrow
4
3865
by: GatorBait | last post by:
Hi, I have created a class library that I call from within my program using late binding. The class library contains a form and I allow the user to do different actions on the form that is part of...
3
4851
by: Steve Long | last post by:
I hope this isn't too stupid of a question but I'm looking for a way to change an item in a listview control when the mouse moves over it. I'd like to change its color and underline it for a...
6
13902
by: Jan Heppen | last post by:
Is it posible to set something so that when my vb.net (visual studio 2005, framework 2.0) application is busy that the mouse pointer change into a hourglass ? Or do i have to set everywhere...
9
1937
by: KDawg44 | last post by:
Hi, I am brand new to Python. In learning anything, I find it useful to actually try to write a useful program to try to tackle an actual problem. I have a syslog server and I would like to...
1
11870
by: Frank Swarbrick | last post by:
We're trying to take advantage of the new ROW CHANGE TIMESTAMP option. Here is a simple table: CREATE TABLE "ACCTASGN"."NUMBER_STATUS" ( "STATUS_CODE" CHAR(1) NOT NULL , "STATUS_DESCRIPTION"...
0
7261
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
7315
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...
1
6974
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...
0
5559
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,...
0
4665
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...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1492
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 ...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
369
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...

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.