These are the ways that you can determine the startup form:
- In C#, the main entry point is main method which is usually in Program.cs. So open Program.cs and set the form in
Application.Run(new Form2())
. - In VB.NET. open project properties and in the Application tab, in the Startup form dropdown, choose the form that you want, for example
Form2
. - In VB.NET if application framework is not enabled, then it works like C#, and a main method is the main entry point and you need to specify the startup form in Application.Run.
- In VB.NET, in solution explorer, click on the Show all files toolbar button, then under the Properties folder, open Application.myapp file and set the start up form like this:
<MainForm>Form2</MainForm>
I can imagine creating a Visual Studio extension to set the startup form, but the thing is sometime, the startup is not necessarily a Form, and you have different logic in startup for different purposes, for example to handle the command line arguments; in this case, you may have different startup forms based on different parameters, for example for print, for sending a message, for login, etc.