What is the best way to hide the main form on application's startup

前端 未结 3 1898
情话喂你
情话喂你 2021-01-25 06:19

What is the best way to hide the main form on application\'s startup to show it later?

If I just call the Hide method in the Load event of this

3条回答
  •  旧时难觅i
    2021-01-25 07:03

    Modify your Program class - this is where the form is created and shown:

    static class Program {
        /// 
        /// The main entry point for the application.
        /// 
        [STAThread]
        static void Main () {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Form1 frm = new Form1();
            frm.Visible = false;
            Application.Run();
        }
    }
    

    Hopefully your adding some sort of user interface?

提交回复
热议问题