473,597 Members | 2,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.C ursor.Current = Cursors.WaitCur sor ??

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

please help me
Oct 2 '06 #1
6 13912
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.C ursor.Current = Cursors.WaitCur sor ??

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.Add MessageFilter. 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.Idl e 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.C ursor.Current = Cursors.WaitCur sor ??

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.Add MessageFilter. 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.Idl e 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.WaitCur sor 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.DoE vents 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
4355
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 hourglass when it refreshes the screen, and this is really annoying since it happens on the timer, about every 100 milliseconds or so. Is there anything I can do about this? Thank you very much. -Eric
1
2187
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 the cursor to a hourglass. But I only can change my own form's cursor using Cursor.Current, whenever I move my mouse cursor into the window, the mouse cursor back to default cursor. I want to change the cursor in the process's window too. Can...
2
10079
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 fine, except that any mouse events generated during this wait period (such as clicking on a button, etc.), get processed once the processing is complete. For example, while waiting for my task to complete, I click on a button (even though the...
9
4863
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 System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Cursor = Cursors.WaitCursor Textbox1.text = Now.Tostring System.Threading.Thread.Sleep(2000) ' 2 second wait
8
16986
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
4161
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 on pixel. <html> <body> <script type = 'text/javascript'> function show_hourglass() { document.getElementById("my_href1").style.cursor = "wait"; document.getElementById("my_href2").style.cursor = "wait";
2
16296
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 finished. In C# and Windows projects, how I can I control the look of the mouse? Thanks
1
2536
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 can get it to show the hourglass, but haven't been able to find anything that would show the hand. Is there something that i could code into the on mouse move event that would maybe load a custom pointer if nothing else?
18
16835
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 changes into hourglass and changes back to pointer during this process. If the user opens other forms or does other things while the main calculations are not finished yet, the results would be disaster. So I want to disarm the user by disabling mouse...
0
7894
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8281
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8381
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8046
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6706
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3893
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
1245
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.