Change Startup Form in C#
-
quinta-feira, 18 de dezembro de 2008 21:31I 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?
Todas as Respostas
-
sexta-feira, 19 de dezembro de 2008 00:03
You need a static main method.
MSMVP VC++- Marcado como Resposta Michael Sun [MSFT]Microsoft Employee, Moderator terça-feira, 23 de dezembro de 2008 07:49
-
segunda-feira, 22 de dezembro de 2008 08:34
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- Marcado como Resposta Michael Sun [MSFT]Microsoft Employee, Moderator terça-feira, 23 de dezembro de 2008 07:49
-
quarta-feira, 9 de maio de 2012 13:10
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

