public void CloseSplashScreen() { if (InvokeRequired) { // We're not in the UI thread, so we need to call BeginInvoke BeginInvoke(new SplashShowCloseDelegate(this.CloseSplashScreen)); return; } this.CloseSplashScreenFlag = true; Close(); }