Skip to content

Instantly share code, notes, and snippets.

@smeghead
Created November 19, 2015 06:50
Show Gist options
  • Save smeghead/afae73e69e14cc4b8075 to your computer and use it in GitHub Desktop.
Save smeghead/afae73e69e14cc4b8075 to your computer and use it in GitHub Desktop.
Windows Forms で、処理中カーソルの後始末を IDisposable を使って行なう。
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
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