Perform some clean up action when form window closed
How do I run some clean up cod开发者_StackOverflow中文版e when a user closes a window?
Subscribe to FormClosing event (if you are using WinForms and not WPF).
You can hook up to the Closing
event on your window (if you are using WPF).
精彩评论