예제 #1
0
        static void mainForm_Load(object sender, EventArgs e)
        {
            //close splash
            if (splashForm == null)
            {
                return;
            }

            splashForm.Invoke(new Action(splashForm.Close));
            splashForm.Dispose();
            splashForm = null;
        }
예제 #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //show splash
            Thread splashThread = new Thread(new ThreadStart(
                                                 delegate
            {
                splashForm = new Splash_Screen();
                Application.Run(splashForm);
            }
                                                 ));

            splashThread.SetApartmentState(ApartmentState.STA);
            splashThread.Start();


            //run form - time taking operation
            MainWindow mainForm = new MainWindow();

            mainForm.Load += new EventHandler(mainForm_Load);
            Application.Run(mainForm);
        }