all groups > dotnet compact framework > january 2008 >
You're in the

dotnet compact framework

group:

Newbie: How to show the wait cursor


Newbie: How to show the wait cursor Norbert Unterberg
1/30/2008 12:54:06 AM
dotnet compact framework: 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,
Re: Newbie: How to show the wait cursor Norbert Unterberg
1/30/2008 1:02:20 PM
Christopher Fairbairn schrieb:

[quoted text, click to view]

Thank you, that did it!

Re: Newbie: How to show the wait cursor Christopher Fairbairn
1/30/2008 4:29:22 PM
Hi,

[quoted text, click to view]

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
AddThis Social Bookmark Button