C# Windows Forms program freezes on form unload
-
Hi, I'm having trouble with C# and windows forms. When I finish the form (using the windows' close button or the form close button), sometimes the program's window get closed but the program never stops (the program executable is still visible in the task list). Did I missing something?
-
Hi, I'm having trouble with C# and windows forms. When I finish the form (using the windows' close button or the form close button), sometimes the program's window get closed but the program never stops (the program executable is still visible in the task list). Did I missing something?
How does the code for your main function looks like. If you are not using code like Application.Run(new Form1()); you need to handle FormClosed event and call Application.Exit
-
Hi, I'm having trouble with C# and windows forms. When I finish the form (using the windows' close button or the form close button), sometimes the program's window get closed but the program never stops (the program executable is still visible in the task list). Did I missing something?
If you create any threads which can safely be disposed of when the program exits, set the
IsBackground
property on it to true. James