Export (0) Print
Expand All

WaitCursor Class

Displays the Wait cursor while an instance exists, and restores the original cursor when it is disposed.

System.Object
  Microsoft.VisualStudio.Modeling.Shell.WaitCursor

Namespace:  Microsoft.VisualStudio.Modeling.Shell
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0.dll)

public sealed class WaitCursor : IDisposable

The WaitCursor type exposes the following members.

  NameDescription
Public methodWaitCursorStores the current cursor and displays the wait cursor whenever the mouse pointer is over the specified user interface control. When the instance is disposed, the current cursor will be restored.
Top

  NameDescription
Public methodClearRestore the original cursor. It is not normally necessary to call this explicitly.
Public methodDisposeRestore the original cursor. This happens automatically at the end of a using block.
Public methodEqualsDetermines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeEnsure that the cursor is cleared when the object is disposed. (Overrides Object.Finalize().)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

This class is designed to be used with the 'using' statement. In the following example, the wait cursor will be displayed while the enclosed block is being executed, whenever the mouse is over the specified control.

using (WaitCursor w = new WaitCursor(control)) 
{/* wait cursor displayed over control while execution is in here */}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft