I’m having a little problem. I set the cursor to wait status. After calling the PrintDialog the cursor returns in default status. I can’t set the cursor to wait status again. The code is like this:
Cursor.Current = Cursors.WaitCursor
[...]
Dim result As DialogResult = printDialog.ShowDialog()
If result = DialogResult.Cancel Then
Return
End If
Cursor.Current = Cursors.WaitCursor
[...]
I just did a small test with your code. When using your code my VS2012 didn’t show up
Cursor.Currentbut did not throw any exception when using it. So I changed it toand the WaitCursor stayed after showing the printDialog.
EDIT: Found a pretty good explanation on difference between Cursor.Current and Cursor!
EDIT2: I changed my code to make use of HourGlass class from @HansPassant’s example stated above. WaitCursor now stays even if you enter a textBox. Anyways – I was still able to get loss of the waitCursor when hovering over the border of eg. a textBox.
All in all IMO I think it’s not very good to force a waitCursor when it is still possible to enter text aso. Perhaps you may consider disabling controls until some kind of actions has finished and afterwards change cursor back.
Hourglass.vb – I hope I did not make any mistakes when converting it to vb.net