I have just switched from VB.Net to C# and am writing a windows application.
In VB.net you could easily change the Shutdown Mode by selecting the properties of the
project and moving to a dropdown where you could choose between “When startup form closes”
and “When last form closes”. Please help me to find the equivalent in C#.
By the way, I’m using VS 2010.
In c# the easiest trick to achieve this is to change the entry point of the application in the “program.cs” file.
This entry form should be hidden on startup,but will call the main form. Then call the Application.Exit(); function in the close procedure in any other form/class.
Sample pseudo code below
program.cs
StratupForm.cs
MainForm.cs
You should probably implement a neater way to manage and keep track of open forms later in your program