473,795 Members | 3,063 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

change cursor to hourglass (WaitCursor) between try..catch

A. I remember microsoft add some features about WaitCursor in
Window.Forms, but I not find it now?

B. I have some Try..Catch in some module and it's suppose to be long
time. I need to change cursor to hourglass. but I have two problem:

1. the function in module not have access to form, (unless I send me
into the module function, but I not like it)
2. if occur err and control jump to catch block, I need to write extra
code to return regular cursor before I open MsgBox with Error msg.

thanks

Jun 29 '06 #1
1 1698
Well in the described situation i would handle this with events

pseudo code :

Try
raisevent changecursorTow ait
do long loop

catch ex as exception

finally
raiseevent changecursorTod efault
end try
this way the cursor will get back to normall state if
1. the code has finished or 2. a exception occurs

as the finally block will always execute
regards

Michel Posseth [MCP]

"mt******@yahoo .com" wrote:
A. I remember microsoft add some features about WaitCursor in
Window.Forms, but I not find it now?

B. I have some Try..Catch in some module and it's suppose to be long
time. I need to change cursor to hourglass. but I have two problem:

1. the function in module not have access to form, (unless I send me
into the module function, but I not like it)
2. if occur err and control jump to catch block, I need to write extra
code to return regular cursor before I open MsgBox with Error msg.

thanks

Jun 29 '06 #2

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

Similar topics

1
2198
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...
5
14463
by: Vlad Simionescu | last post by:
Hello I'm trying to let my Windows Form application perform a lengthy operation while displaying a progress bar in a modal dialog window; the dialog has a cancel button. The dialog is displayed in the main thread while the work is done in a background thread. I managed to do it except for one minor problem: I want the cursor to be hourglass when it is over the main window and be normal (arrow) when it is over the dialog box. I cannot do...
2
1780
by: dave | last post by:
In my form Ive got a SaveData() routine that saves changes to a DB. When I encounter an exception in the save operations, I am having trouble chaning the cursor back to the default cursor, it just stays as an hourglass. It seems as though the cursor can only be set in the context of the form. I would like to set the cursor within my standard error handling module. See code below... Any ideas? Thanks, Dave
8
16997
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
4
3892
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 the class library dll. I am having a hard time figuring out how to change the cursor between an hourglass and arrow for those time periods when work is being done. I have tried Cursor = Cursors.WaitCursor and Cursor = Cursors.Arrow, but the...
3
8916
by: Wayne Wengert | last post by:
In VB.NET is there a way to set the mouse cursor to the Wait cursor that will stay in effect across several forms? For example, I want to set the cursor to the WaitCursor in formA just before it calls formB and FormB may, in turn, call another form. I want the WaitCursor until control is returned to formA where I reset it to Default. (I believe that in VB6 there was the notion of a screen cursor - that is what I want) TIA Wayne
0
1152
by: shumaker | last post by:
private void processImports_Click(object sender, EventArgs e) { statusLabel.Text = "Processing..."; this.Cursor = Cursors.WaitCursor; Application.DoEvents(); this.Enabled = false; progressBar.Value = 0; try{... lots of processing} ....
6
13935
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 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
6
19905
by: wil1cad2 | last post by:
I'm using VB studio 2005. Pls help to change cursor to HourGlass when u press a button and wait for calcualtion the result. Ex: If btnCalculate.Enabled = True Then Screen.MousePointer = vbHourglass Else Screen.MousePointer = vbDefault End If I got some thought above but doesn't work.
0
9519
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
10436
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
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9040
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...
0
5436
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
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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 we have to send another system
2
3722
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
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.