Guideline ideas for using Cursor.Current and UseWaitCursor

In the .NET Framework System.Windows.Forms namespace, there are many ways to set cursors:

CONSIDER indicating activity of an operation by showing the wait cursor. This provides feedback to the user that the operation started and is still in progress. This should be included by default in all UI event handlers, because the duration of an operation depends on many factors outside of the programmer’s control, e.g. file access over the network.

DO NOT use the Cursor property to signal a long-running application. This property should be used only to change the cursor to indicate the action that is currently available for the control, e.g. a hand (for panning) or I-beam (to edit text).

DO use Cursor.Current = Cursor.WaitCursor before you’re starting a long-running operation that does not involve user interface changes and the cursor should change immediately. The cursor will be reset automatically as soon as the current thread returns to it’s message loop.

DO set UseWaitCursor to true when the target control, form, or, most commonly, the entire application execute a possibly long-running operation that involves one or more user interface changes or intermediate windows such as a progress dialog, or operations that indicate progress and completion using events. Note, that the cursor is not changed until the thread returns to the message loop. Note, that new forms do not inherit the UseWaitCursors value from Application.

This entry was posted in Software Development. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s