"Armin Zingler" <(E-Mail Removed)> schrieb
> "Herfried K. Wagner [MVP]" <(E-Mail Removed)> schrieb
> > Hello,
> >
> > "Armin Zingler" <(E-Mail Removed)> schrieb:
> > > is it right that the cursor is *always* set back to it's
> > > default when the application is idle?
> >
> >
>
http://msdn.microsoft.com/library/en...rrenttopic.asp
>
> You probably know that I know this topic but it doesn't answer my
> question.
>
> I asked because setting it to the default cursor afterwards might be
> wrong because it is possible that before setting it to
> Cursors.Hourglass, it has not been the default cursor (e.g.
> AppStarting).
One thing to add, and why I was a little confused:
Set a Form's cursor property to AppStarting. Add a button to the form. In
the Button_Click event handler add this code:
Cursor.Current = Cursors.WaitCursor
Cursor.Current = Cursors.Default
Start and click the button => the cursor is restored to AppStarting (as
expected).
Stop the app, and add a timer (Winforms Timer, interval=5000, enabled=true).
Add the same two lines in the timer's tick event handler. Start again, move
the mouse so that it is located over the form. Don't move it anymore! Wait
til the tick event fires => The cursor is *not* restored.
So, there is a difference between setting "Cursor.Current = Cursors.Default"
in a Button's click event and a Timer's tick event. I don't know why.
--
Armin