Change Startup Form in C#
-
Thursday, December 18, 2008 9:31 PMI want to change the startup form for a C# Windows Application. I tried going to Project Properties and in the Application tab there is a drop down for Startup Object. However, none of the project forms are listed there. The only thing listed is NameoftheApplication.program. Should I be looking in another place?
All Replies
-
Friday, December 19, 2008 12:03 AM
You need a static main method.
MSMVP VC++- Marked As Answer by Michael Sun [MSFT]Microsoft Employee, Moderator Tuesday, December 23, 2008 7:49 AM
-
Monday, December 22, 2008 8:34 AM
In your program.cs, you should see a line Application.Run(new <something>);. You can change that something to the form you want to run as startup form
MVP Client App- Marked As Answer by Michael Sun [MSFT]Microsoft Employee, Moderator Tuesday, December 23, 2008 7:49 AM
-
Wednesday, May 09, 2012 1:10 PM
Go to Program.cs from the solution explorer.Modify the last line of code to this:
Application.Run(new your_start_up_forms_constructor());
For example: if your want to open Form1 write:
Application.Run(new Form1());
Hope it helps
Arunava Saha

