How to set which of the forms appear first

前端 未结 4 1807
北恋
北恋 2020-12-29 12:35

I\'m a beginner c# programmer, and i\'m getting familiar with the Windows Forms App. I have 2 forms and i\'m trying to understand how to set one of them to be the first one

4条回答
  •  再見小時候
    2020-12-29 13:03

    In your visual studi, when ever you open a project by default program.cs will open.

       static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    

    you can see above Application.Run(new Form1());

    whatever your form name is type there, then whenever you are starting first this form will run

提交回复
热议问题