In your code example, did frm2
make a call to Application.Exit
? If it did, then why are you trying to call this.Show
again?
Anyway, you may have a problem related to how you started the application's message loop. Are you running Application.Run()
, or Application.Run(form1)
?
If you provided a form to Application.Run()
when you started your message loop, then you should not be calling Application.Exit
in order to exit the application. Instead, you should simply close your main window, that would cause the message loop to finish, the call to Application.Run
to return, and your application will terminate cleanly.