Created
November 19, 2015 06:50
-
-
Save smeghead/afae73e69e14cc4b8075 to your computer and use it in GitHub Desktop.
Windows Forms で、処理中カーソルの後始末を IDisposable を使って行なう。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Namespace Utils | |
Public Class BusyProcess | |
Implements IDisposable | |
Private form As Form | |
Public Sub New(form As Form) | |
Me.form = form | |
Me.form.Cursor = Cursors.WaitCursor | |
End Sub | |
Public Sub Dispose() Implements IDisposable.Dispose | |
Me.form.Cursor = Cursors.Default | |
End Sub | |
End Class | |
End Namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using New BusyProcess(Me) | |
'do something | |
End Using |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment