Esempio n. 1
0
        static void main_Load(object sender, EventArgs e)
        {
            //close splash
            if (splashScreen == null)
            {
                return;
            }

            splashScreen.Invoke(new Action(splashScreen.Close));
            splashScreen.Dispose();
            splashScreen = null;
        }
Esempio n. 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Thread splashThread = new Thread(new ThreadStart(delegate {
                splashScreen = new LoginSplashScreen();
                Application.Run(splashScreen);
            }));

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

            MainWindow main = new MainWindow();

            main.Load += new EventHandler(main_Load);

            Application.Run(main);
        }