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.
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.