Hi,
Use Application.ApplicationExit event
I'm not sure if it does work in 3 though. but you can try it anyway.
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
<an********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
I want to run some code when my Windows Form Application is being shut
down.
I want to run this code when the Application is being shut down in the
following situation:
1. The App is being shut down by the user.
2. The App is being shut down because of Windows System Shut Down.
3. The App Process is being killed in Task Manager
4. The App is shut down because I click "Stop" in Visual Studio.
5. The App is shut down, because of some reason I forget in this list.
3,4 and 5, ofcause only if possible.
How do I Achive this, in what event should I put my code ??
Best Regards , Anders Both - Denmark.