Posted: 8/16/2011
I am attempting to use a wait cursor in a Windows Forms Application. I can get the wait cursor property to work fine if I call it from a Windows Form class, but it does not work properly when I call it from a code class. Here are two types of calls I have attempted to make:
Application.UseWaitCursor = True Main.UseWaitCursor = True
Basically, my program calls a few code classes to load a bunch of data, and along the way these code classes have to show pop-ups to prompt the user for any missing values. So, at some points in the code I would like to tell the main form to show the wait cursor. Hence, the Main.UseWaitCursor = true. However, the main cursor does not change until the application is done loading the data. I have tried forcing a refresh to the main form, but to no avail.
Please help!
Finally figured this out. I used the following code and it worked fine.
'Apply the Wait Cursor Cursor.Current = Cursors.WaitCursor