static public void ShowSplashScreen(string ImagePath) { if (_ssForm != null) throw new InvalidOperationException("Splash screen already shown"); _ssForm = new SplashScreen(ImagePath); _ssThread = new Thread(new ThreadStart(ShowForm)); _ssThread.IsBackground = true; _ssThread.SetApartmentState(ApartmentState.STA); _ssThread.Start(); }
static public void HideSplashScreen() { if (_ssForm == null) throw new InvalidOperationException("Splash screen not shown shown"); _ssForm.BeginInvoke(new MethodInvoker(_ssForm.Close)); _ssThread = null; _ssForm = null; }