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

M

mtczx232

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
 
G

Guest

Well in the described situation i would handle this with events

pseudo code :

Try
raisevent changecursorTowait
do long loop

catch ex as exception

finally
raiseevent changecursorTodefault
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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top