Cursor.Current bug?

C

Chris Shepherd

According to the docs, setting Cursor.Current will change the cursor
being displayed, and block mouse events:

"Setting the Current property changes the cursor currently displayed,
and the application stops listening for mouse events. For example, you
might set the Current property to Cursors.WaitCursor before you start
filling a TreeView, DataGrid, or ListBox control with a large amount of
data. After the loop is completed, set this property back to
Cursors.Default to display the appropriate cursor for each control."

Unfortunately, I can't seem to actually get this behaviour to work.
Quick steps to reproduce:

- Create a new form project.
- Handle the Load event of Form1, and in the eventhandler add:

Cursor.Current = Cursors.WaitCursor;
//this.Cursor = Cursors.WaitCursor;

The former does not seem to actually apply the change in cursor (at
least, it isn't for me), however the latter (once uncommented) works
perfectly fine. I suppose I could use this.TopLevelControl.Cursor to
ensure it works for all controls.

I'm thinking I've missed something somewhere, I just don't know what.

Chris.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top