Do you use AutoWaitCursor on Windows applications?

Last updated by Igor Goldobin about 2 months ago.See history

It can be extremely tiresome to have to continually remember to set and unset the wait cursor for an application. If an exception occurs you have to remember to add a try finally block to restore the cursor, or if you popup a message box you must remember to change the cursor first otherwise the user will just sit there thinking the application is busy.

autowaitcursor bad
Figure: Bad example - Cursor set manually

autowaitcursor good
Figure: Good example - Implemented AutoWaitCursor

AutoWaitCursor Class automatically monitors the state of an application and sets and restores the cursor according to whether the application is busy or not. All that required are a few lines of setup code and you are done. See this great blog on how to use AutoWaitCursor. If you have a multithreaded application, it won't change the cursor unless the main input thread is blocked. In fact, you can remove all of your cursor setting code everywhere!

We open source. Powered by GitHub