Hello,
I have a program that runs threads for networking, and whenever I close it by pressing the X button in the top right corner the program threads still run, so I have to go to the task manager every time to close it. The only event I have is Server_Closing which is as follows:
private void Server_Closing(object sender, CancelEventArgs e)
{
this.Close();
Application.Exit();
}
Anyone have any suggestions on how to kill all running threads when the application closes so I don't have to go to the task manager every time? I need help!!!
-- Frustrated Programmer
I have a program that runs threads for networking, and whenever I close it by pressing the X button in the top right corner the program threads still run, so I have to go to the task manager every time to close it. The only event I have is Server_Closing which is as follows:
private void Server_Closing(object sender, CancelEventArgs e)
{
this.Close();
Application.Exit();
}
Anyone have any suggestions on how to kill all running threads when the application closes so I don't have to go to the task manager every time? I need help!!!
-- Frustrated Programmer