Newbie: How to show the wait cursor

  • Thread starter Thread starter Norbert Unterberg
  • Start date Start date
N

Norbert Unterberg

I have a question that should be easy for you:

How do I show the wait symbol? I mean when an application starts you get the
symbol on the center of the PDA screen with the rotating colors.

Nowe I have some lengthy operation in my app, how do I show this symbol? I'd try
UseWaitCursor, but this does not seem to be supported on the CF.

Thanks,
Norbert
 
Hi,

Norbert Unterberg said:
How do I show the wait symbol? I mean when an application starts you get
the symbol on the center of the PDA screen with the rotating colors.

Try using the following code:

using System.Windows.Forms;

try
{
Cursor.Current = Cursrors.WaitCursor;

// do your lengthy operation here
}
finally
{
Cursor.Current = Cursors.Default;
}

This will show the standard wait cursor , perform your lengthy operation and
then return to the default (no) cursor. I usually use a try/finally block so
that the cursor is correctly returned to the default cursor even if the
lengthy operation throws an exception etc.

Hope this helps,
Christopher Fairbairn
 
Christopher said:
Try using the following code:

using System.Windows.Forms;

try
{
Cursor.Current = Cursrors.WaitCursor;

// do your lengthy operation here
}
finally
{
Cursor.Current = Cursors.Default;
}

Thank you, that did it!

Norbert
 
Back
Top