How to know when application is exit in .Net Compact framework?
I have a .Net Compact Framework WinForm application , I want to catch Application OnExit event but there开发者_如何学编程 is no such event available.
Does anyone know any work around to achieve the same ?
Application2 from the OpenNETCF framework has an ApplicationExit event.
If your app is not too complicated you could substitute Application2 for Application. (I have had some problems with the Application2 stuff but my code was a little bit "edge case").
If your app is architected "normally" that is the Form being passed to Application.Run
is closed, then whatever code is after the call to Run
in Main
is going to execute. You could raise your own event there, or do whatever handling you need at that point.
精彩评论