Question : C# - Problem in closing application form

Hello,

I have a C# application with Form.
When I close the form by pressing "X", my application stucks.
Why does it happening? How Can I debug the problem?

Thank you
1:
2:
3:
4:
private void fclsRS232Tester_FormClosed(object sender, FormClosedEventArgs e)
      {
           Application.Exit();
     }

Answer : C# - Problem in closing application form

Is the fclsRS232Tester Form the "startup form"?  If so, you don't need the "Application.Exit()" call.  The app will close by itself when the "startup form" is closed.  Whatever form is passed to the Application.Run() line in program.cs is the "startup form".
Random Solutions  
 
programming4us programming4us