Adrian Grigore
Adrian Grigore

Reputation: 33318

How do I programmatically show the waiting icon on Windows Mobile 6?

How do I programmatically show the waiting icon on Windows Mobile 6?

It should be easy to do, but I could not google it since there are so many waiting icon replacements out there... :-)

Thanks,

Adrian

Upvotes: 1

Views: 965

Answers (2)

ctacke
ctacke

Reputation: 67178

Something like this is somewhat useful:

class WaitCursor : IDisposable
{
    public WaitCursor()
    {
        Cursor.Current = Cursors.WaitCursor;
    }

    public void Dispose()
    {
        Cursor.Current = Cursors.Default;
    }
}

It allows you to make use of "using" blocks to return to the default cursor even if you have an exception or a return:

public Foo()
{
    using (var c = new WaitCursor())
    {
       // do long-running stuff
       // when we exit the using block, the cursor will return to the default state
    }
}

Upvotes: 3

PaulG
PaulG

Reputation: 14041

You mean the wait cursor?

using System.Windows.Forms;
Cursor.Current = Cursors.WaitCursor;

Upvotes: 1

Related Questions