Locked Change Startup Form in C#

  • quinta-feira, 18 de dezembro de 2008 21:31
     
     
    I 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
     
     Respondido
    You need a static main method.
    MSMVP VC++
  • segunda-feira, 22 de dezembro de 2008 08:34
     
     Respondido
    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
  • quarta-feira, 9 de maio de 2012 13:10
     
     
    You cannot vote on your own postGo 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