Share via


WaitCursor Class

Definition

Provides a convenience class for displaying a wait cursor (typically an hourglass shape) during a lengthy operation.

public ref class WaitCursor sealed : IDisposable
public sealed class WaitCursor : IDisposable
type WaitCursor = class
    interface IDisposable
Public NotInheritable Class WaitCursor
Implements IDisposable
Inheritance
WaitCursor
Implements

Examples

The following example displays a WaitCursor object while the user settings are saved.

private void butClickSaveSettings(object sender, EventArgs e) {

    using (new WaitCursor()) {
        SaveSettings();
    }
} 

Remarks

You should define the scope of a lengthy operation with the using statement so the default cursor will be automatically restored when the operation is complete.

Constructors

WaitCursor()

Initializes a new instance of the WaitCursor class.

Methods

Dispose()

Releases all resources used by the WaitCursor class.

Applies to