How to run some cleanup code when a user closes a window?
Subscribe to the FormClosing event (if you use WinForms, not WPF).
You can connect to an event Closingin your window (if you are using WPF).
Closing
Source: https://habr.com/ru/post/1771296/More articles:PHP Soap Error: The server was unable to process the request. ---> The reference to the object is not installed in the object instance - soapDo I need to use Google Account Authentication instead of Spring Authentication to avoid Firesheep cookie-sniffing attacks? - javaКак преобразовать URL-адрес html-страницы в pdf в java с помощью iText и летающей тарелки? - javaSharePoint Document or Download / View Event Handler? - event-handlingexception with no 'to_query' method - ruby | fooobar.comThere is a bunch of PHP dump in OutOfMemory exception - heapIs there a shorter way to define a list, for example. 100 new arrays? - javascriptForeach, специальная обработка каждого n-го элемента (нечетное, например, например) - phpTurn boost :: tuples :: cons <...> back into the corresponding boost :: tuple <...> - c ++Передача команд между двумя компьютерами через Интернет - javaAll Articles