Home All Groups Group Topic Archive Search About

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

Author
29 Jun 2006 11:27 AM
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

Author
29 Jun 2006 3:04 PM
M. Posseth
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]



Show quoteHide quote
"mtczx***@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
>
>