• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

activate code , When Exit

I'm working in an instant messging tool , I want it to log off whenever it's closed,
how can i run the log off code when the program is closed.
0
seriousbrain
Asked:
seriousbrain
1 Solution
 
fromerojCommented:
0
 
AlexFMCommented:
You can use Application.ApplicationExit Event:

Application.ApplicationExit += new EventHandler(this.OnApplicationExit);

private void OnApplicationExit(object sender, EventArgs e)
{
   // ...
}
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now