This is a really annoying and yet probably trival issue but ...
I have a main form (frmMainMenu) where the users have a couple of choices of other forms to view, when they do that frmMainMenu is hidden (as it is no longer required but it is the starting point of everthing so can't just get rid of it).
Anyways - so frmMainMenu is hidden (this.Hide()) and it creates and .Shows other forms, these in turn may also lead to other forms (where they will then be hidden) and so on...
Now to the problem - funny thing is when all is said and done and I EXIT (hit the 'x' in the top-right corner of the window) I expect my application (all of it) to close but instead it remains in memory (I have to kill it manually via the process list)...
I assume this is because when I click the 'x' it only closes THAT form and all the hidden ones that came before it are still running but are just "hidden"...
Well when I hit the 'x' on ANY of my forms I want the entire application to close (gracefully, no leaks due to forms, etc...) as it should...
Any ideas, hints, and help would be greatly appreciated, thanks
I have a main form (frmMainMenu) where the users have a couple of choices of other forms to view, when they do that frmMainMenu is hidden (as it is no longer required but it is the starting point of everthing so can't just get rid of it).
Anyways - so frmMainMenu is hidden (this.Hide()) and it creates and .Shows other forms, these in turn may also lead to other forms (where they will then be hidden) and so on...
Now to the problem - funny thing is when all is said and done and I EXIT (hit the 'x' in the top-right corner of the window) I expect my application (all of it) to close but instead it remains in memory (I have to kill it manually via the process list)...
I assume this is because when I click the 'x' it only closes THAT form and all the hidden ones that came before it are still running but are just "hidden"...
Well when I hit the 'x' on ANY of my forms I want the entire application to close (gracefully, no leaks due to forms, etc...) as it should...
Any ideas, hints, and help would be greatly appreciated, thanks