In WinForms, setting the cursor to Cursors.Wait, and back to Cursors.Default would allow for an hour glass like effect to notify the user that the application is busy.
To achieve this with WPF in a quick and dirty way, you can simply override the mouse cursor.
Notice, we are setting the cursor to null at the end. This is going to achieve the same thing as Cursors.Default, but the reason we don't use that is because it is using System.Windows.Input.Cursors and not System.Windows.Forms.Cursors and thus there is no .Default. Setting to null results in the cursor going to default... by default.
To achieve this with WPF in a quick and dirty way, you can simply override the mouse cursor.
1 2 3 | Mouse.OverrideCursor = Cursors.Wait; //code here Mouse.OverrideCursor = null; |
Notice, we are setting the cursor to null at the end. This is going to achieve the same thing as Cursors.Default, but the reason we don't use that is because it is using System.Windows.Input.Cursors and not System.Windows.Forms.Cursors and thus there is no .Default. Setting to null results in the cursor going to default... by default.
Comments
Post a Comment