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

automaticly change mouse pointer into hourglass

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 where my application do something
Windows.Forms.Cursor.Current = Cursors.WaitCursor ??

something is for example calling the sql-server database to get/set data

please help me
Oct 2 '06 #1
6 13890
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 where my application do something
Windows.Forms.Cursor.Current = Cursors.WaitCursor ??

something is for example calling the sql-server database to get/set data
Well, you don't want to set WaitCursor at all times when your 'application
is busy'. Your app gets busy at Window's discretion more often than you
realize. However, you could probably detect busy status via
Application.AddMessageFilter. I advise against it.

What you could do is to set WaitCursor at the places where your app gets
'significantly' busy, and set CursorNormal in an Application.Idle event
handler. I would bookkeep your app's cursor status in a global variable so
that you can no-op attempts to set it to busy when it is already busy (or to
normal when it is already normal). You might want to set the cursor for all
forms in your app at the same time. All this suggests a sub whose calling
sequence takes a boolean busy-notbusy parameter.
Oct 2 '06 #2

"AMercer" wrote:
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 where my application do something
Windows.Forms.Cursor.Current = Cursors.WaitCursor ??

something is for example calling the sql-server database to get/set data

Well, you don't want to set WaitCursor at all times when your 'application
is busy'. Your app gets busy at Window's discretion more often than you
realize. However, you could probably detect busy status via
Application.AddMessageFilter. I advise against it.

What you could do is to set WaitCursor at the places where your app gets
'significantly' busy, and set CursorNormal in an Application.Idle event
handler. I would bookkeep your app's cursor status in a global variable so
that you can no-op attempts to set it to busy when it is already busy (or to
normal when it is already normal). You might want to set the cursor for all
forms in your app at the same time. All this suggests a sub whose calling
sequence takes a boolean busy-notbusy parameter.
Is there an other (easier) way to show an user that the application is busy
at the time ?
for example when I ask information at the database the sql server is serval
seconds busy to retrief all the data and display it to the user. I want to
make clear to the user that the application is busy at the time. so what is
the best way to do this ?

Jan
Oct 2 '06 #3
Is there an other (easier) way to show an user that the application is busy
at the time ?
for example when I ask information at the database the sql server is serval
seconds busy to retrief all the data and display it to the user. I want to
make clear to the user that the application is busy at the time. so what is
the best way to do this ?
In my opinion, WaitCursor is the best way. It is also the conventional way
in windows. You could make something up (eg a color change to your form(s)),
but it would take some effort, so my guess is that WaitCursor is the easiest
way as well.

Oct 2 '06 #4
Jan Heppen wrote:
"AMercer" wrote:
Is there an other (easier) way to show an user that the application is busy
at the time ?
for example when I ask information at the database the sql server is serval
seconds busy to retrief all the data and display it to the user. I want to
make clear to the user that the application is busy at the time. so what is
the best way to do this ?

Jan
We usually popup a borderless window with a message like "Please wait,
retrieving data" or something to that effect.

--
Rinze van Huizen
C-Services Holland b.v
Oct 3 '06 #5
Is there an other (easier) way to show an user that the application is
busy
at the time ?
for example when I ask information at the database the sql server is serval
seconds busy to retrief all the data and display it to the user. I want to
make clear to the user that the application is busy at the time. so what is
the best way to do this ?

In my opinion, WaitCursor is the best way. It is also the conventional way
in windows. You could make something up (eg a color change to your form(s)),
but it would take some effort, so my guess is that WaitCursor is the easiest
way as well.
Is it correct that when I think the client could be busy and I call the
function WaitCursor that it automaticly comes back to the "normal arrow
state" or is the WaitCursor still active at the background ?

I tried somethings but when the client is ready and is back in the "normal
arrow state" I don't get the WaitCursor state. Unless I call it again. So it
seems that I only have to call WaitCursor when I think the client could be
busy and Windows does the rest and sets the cursor back to normal when the
data is retrieved.
Oct 4 '06 #6
Is it correct that when I think the client could be busy and I call the
function WaitCursor that it automaticly comes back to the "normal arrow
state" or is the WaitCursor still active at the background ?

I tried somethings but when the client is ready and is back in the "normal
arrow state" I don't get the WaitCursor state. Unless I call it again. So it
seems that I only have to call WaitCursor when I think the client could be
busy and Windows does the rest and sets the cursor back to normal when the
data is retrieved.
I set the control's .Cursor property, and I don't mess with the .Current
property, so I am on unfamiliar ground. The documentation says that if you
change .Current, and the call DoEvents, the .Current property will be
restored:

"All controls that derive from the Control class have a Cursor property. To
change the cursor displayed by the mouse pointer when it is within the bounds
of the control, assign a Cursor to the Cursor property of the control.
Alternatively, you can display cursors at the application level by assigning
a Cursor to the Current property. For example, if the purpose of your
application is to edit a text file, you might set the Current property to
Cursors.WaitCursor to display a wait cursor over the application while the
file loads or saves to prevent any mouse events from being processed. When
the process is complete, set the Current property to Cursors.Default for the
application to display the appropriate cursor over each control type.

Note If you call Application.DoEvents before resetting the Current
property back to the Cursors.Default cursor, the application will resume
listening for mouse events and will resume displaying the appropriate Cursor
for each control in the application."

Oct 6 '06 #7

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

Similar topics

1
by: Eric Adem | last post by:
I have a JavaScript routine that runs on a timer and updates the position of a background image using the CSS background-position property. In Internet Explorer, it changes the mouse pointer to an...
1
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...
2
by: KarenP | last post by:
In my Windows Forms application, while executing a process that takes some time, I am changing the cursor to the hourglass by setting Cursor.Current = Cursors.WaitCursor. This is working just...
9
by: DotNetShadow | last post by:
Hi Guys, I have been having this problem recently where I have a form with a textbox and button, if in the button event I have the following: Private Sub Button1_Click(ByVal sender As...
8
by: Eddie | last post by:
Hi All, I just want to change the mouse cursor during a process. I want a hourglass... How may I do it ? Thx
1
by: Stefan Mueller | last post by:
With the following code I can change the mouse pointer. However, if you click in Mozilla (with IE it works perfect) on 'Show hourglass' the mouse pointer changes only if you move the mouse at least...
2
by: diatom | last post by:
Hello, I have a custom dialog. When the user hits the 'Ok' button, I want my mouse to turn into an hourglass while its performing work - and then I want it to go back to normal afer the work is...
1
by: mswhiteside | last post by:
Hello All, What i'm trying to do is in a form, for a box, make it so that when the mouse is over it it is the hand, instead of the mouse pointer. I can't seem to get anything to work though. I...
18
Alireza355
by: Alireza355 | last post by:
Dear friends, I have a command button that when clicked, runs tens of queries, millions of calculations, etc. This process takes about 10 seconds each time, and the mouse pointer rapidly...
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...
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...
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
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...

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.