protected override void OnLoad(EventArgs e) { base.OnLoad(e); // or do all expensive loading here (or in the constructor if you prefer) _splash.Close(); }
/// <summary> /// handles the normal splash screen /// </summary> private void ShowNormalSplash() { _frm = new SplashForm { TopMost = _alwaysOnTop }; _frm.Location = new Point(CurrentDisplay.Bounds.X + CurrentDisplay.Bounds.Width / 2 - _frm.Size.Width / 2, CurrentDisplay.Bounds.Y + CurrentDisplay.Bounds.Height / 2 - _frm.Size.Height / 2); _frm.SetVersion(Version); _frm.Show(); _frm.Update(); _frm.FadeIn(); string oldInfo = null; // run until stop of splash screen is requested while (!_stopRequested) { if (oldInfo != _info) { _frm.SetInformation(_info); oldInfo = _info; } Thread.Sleep(10); } _frm.FadeOut(); _frm.Close(); _frm = null; }
static void Main() { if (System.Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Thread to show splash window Thread thUI = new Thread(new ThreadStart(ShowSplashWindow)); thUI.Name = "Splash UI"; thUI.Priority = ThreadPriority.Highest; thUI.IsBackground = true; thUI.Start(); //Thread to load time-consuming resources. Thread th = new Thread(new ThreadStart(LoadResources)); th.Name = "Resource Loader"; th.Priority = ThreadPriority.Normal; th.Start(); th.Join(); if (SplashForm != null) { SplashForm.Invoke(new MethodInvoker(delegate { SplashForm.Close(); })); } thUI.Join(); Application.Run(new Form1()); }
private static void Application_Idle(object sender, EventArgs e) { // The application is now ready to load the main form if (_Context.MainForm == null) { // Prevent duplicate event firing Application.Idle -= new EventHandler(Application_Idle); //// pre initialize components PreInitializeComponents(); // Load the main form _Context.MainForm = new BilancioFenealgest.UI.UIComponents.Form1(); // Show the form _Context.MainForm.Show(); // Hide the splash screen _Splash.Close(); _Splash = null; } }
static void Main() { Application.EnableVisualStyles(); Application.DoEvents(); CustomExceptionHandler eh = new CustomExceptionHandler(); Application.ThreadException += new ThreadExceptionEventHandler(eh.OnThreadException); SplashForm splash = new SplashForm() ; try { splash.Show(); } catch (Exception) { } Thread.Sleep(4000); splash.Close() ; frm = new MainForm() ; Application.Run(frm); }
private void DispatcherView_Load(object sender, EventArgs e) { Hide(); HidePanels(true); //hide all panels on start GetandFillOders(); //splash bool done = false; ThreadPool.QueueUserWorkItem((x) => { using (var splashForm = new SplashForm()) { splashForm.Show(); while (!done) Application.DoEvents(); splashForm.Close(); } }); Thread.Sleep(2000); // Emulate hardwork done = true; Show(); //timer thread Thread t = new Thread(new ThreadStart(TimerInvoker)); t.IsBackground = true; t.Start(); }
private void FormMain_Load(object sender, EventArgs e) { this.Text = $"{typeof(Program).Assembly.GetName().Name} - 全节点版 V{Application.ProductVersion} © 币合区块链"; AnimateWindows.ShowAnimateWindow(this, 500, WinFormEx.AnimateWindows.AW_BLEND); wbAnalysis.Url = new Uri(Program.analysisUrl, UriKind.Absolute); plBlockInfo.Dock = DockStyle.Fill; plShowLog.Dock = DockStyle.Fill; plSetting.Dock = DockStyle.Fill; plAbout.Dock = DockStyle.Fill; plSend.Dock = DockStyle.Fill; btnBlockInfo.PerformClick(); //btnShowLog.PerformClick(); //加载完成关闭启动窗体 SplashForm.Close(); if (!Program.isUpdate) { this.Activate(); } if (ihslib.FileHandle.FileHelper.IsExistFile(GlobalVar.lock_file)) { btnInit.Enabled = false; } else { btnInit.Enabled = true; } GetStateDB(); cBoxRpc.SelectedIndex = 0; BindAccount(); }
void MainForm_Load(object sender, EventArgs e) { if (_splashForm != null) { _splashForm.Close(); _splashForm.Dispose(); } WindowState = FormWindowState.Maximized; }
private static SplashForm splash;// = new SplashForm(); internal static void Launch() { Application.CurrentCulture = CultureInfo.InvariantCulture; Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); splash = new SplashForm(); splash.Show(); Timer timer = new Timer(); //Configure this timer to restart each second ( 1000 millis) timer.Interval = 1000; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); timer.Start(); //splash.Refresh(); //Application.DoEvents(); Application.DoEvents(); MainModule.Initialize("data"); splash.SetLoadProgress(50); splash.Refresh(); Application.DoEvents(); UpdaterHelper.UpdateInfo info; info = UpdaterHelper.CheckFromUpdates(); Application.DoEvents(); if (info.UpdateAvailable) { UpdateForm updateForm; updateForm = new UpdateForm(info); updateForm.ShowDialog(); Application.DoEvents(); } splash.SetLoadProgress(60); splash.Refresh(); Application.DoEvents(); IconsManager.Initialize(); Application.DoEvents(); MainForm main = new MainForm(); //if (runSingleInstance) //{ // main.HandleCreated += new EventHandler(main_HandleCreated); //} GC.Collect(); timer.Stop(); timer.Close(); splash.SetLoadProgress(100); splash.Refresh(); Application.DoEvents(); splash.Close(); splash = null; Application.DoEvents(); Application.Run(main); } //Launch
private static void MainForm_LoadCompleted(object sender, EventArgs e) { if (SplashForm == null || SplashForm.Disposing || SplashForm.IsDisposed) { return; } SplashForm.Invoke(new Action(() => { SplashForm.Close(); })); SplashForm.Dispose(); SplashForm = null; MainForm.Activate(); }
/// <summary> /// Updates the UI /// </summary> protected void UpdateUI(bool IsDataLoaded) { if (IsDataLoaded) { if (frmSplash != null) { frmSplash.Close(); } WindowState = FormWindowState.Normal; } }
private static void HideSplashScreen() { if (_splash != null) { Action act = () => { _splash.Close(); _splashThread = null; }; _splash.Invoke(act); } }
private async Task StartAsync() { using var splashForm = new SplashForm(); splashForm.Show(); var mainForm = new MainForm(DIContainer.ComputerRepository); mainForm.FormClosed += (s, e) => Application.ExitThread(); mainForm.Shown += (s, e) => splashForm.Close(); await mainForm.InitializeAsync(); mainForm.Show(); }
private void AboutBox_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { if (m_splash_form != null) { m_splash_form.Close(); m_splash_form.Dispose(); m_splash_form = null; } this.Close(); } }
public void Enrolement(String _idVisiteur) { ChangeLabelStatus("Status: Début enrolement."); SplashForm sf = new SplashForm(); sf.affiche("Enrôlement en cour..."); idVisiteur = _idVisiteur; try { DownloadXML(1); TraiterXML(); bio = new Biovein(IP, port, mdp); DownloadXML(0); TraiterXML(); /*on enrole la personne et on récupère le template*/ String template = Enroler(nom, prenom, droits, 1); if (template == "") { ChangeLabelStatus("Status:[Fin] Echec Enrôle."); sf.Close(); return; } /*enregistrement du template dans la base de donnée*/ SendDataToAdd(template, (uint)template.Length); } catch (Exception ex) { Program.LogFich.Error("[BioveinEdenManager] Enrolement() - Erreur : " + ex.ToString()); } /*Fin Enrolement*/ sf.Close(); ChangeLabelStatus("Status: Fin enrolement."); }
private static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // load current culture, en-US or zh-CN // make be can change to configalbe later. Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture; // load resource files MainForm.LocRM = new ResourceManager("WinApt.Client.WinAptStrings", typeof(MainForm).Assembly); SplashForm mySplash = new SplashForm(); bool exitFlag = false; mySplash.Show(); try { //when the fisrt time run this program, exception("new") throws mySplash.InitApp(); } catch (Exception e) { //build new config file. if (e.Message == "new") { ChoseForm myChoseForm = new ChoseForm(); myChoseForm.ShowDialog(mySplash); if (myChoseForm.DialogResult == DialogResult.OK) { myChoseForm.Config(); mySplash.InitApp(); } myChoseForm.Close(); } else { MessageBox.Show(e.Message); exitFlag = true; } } finally { mySplash.Close(); } if (exitFlag) { return; } Application.Run(new MainForm()); }
public static void Run(SplashForm splash, MainForm form) { splash.CreateAction += (s, e) => { form.Initialize(splash); }; form.Load += (s, e) => { splash.Close(); }; splash.Show(); while (!splash.Done) Application.DoEvents(); //Application.Run(form); form.Show(); while (form.Created) Application.DoEvents(); }
public static void ShowSplashScreen() { //Ick, DoEvents! But we were having problems with CloseSplashScreen being called //before ShowSplashScreen - this hack was found at //http://stackoverflow.com/questions/48916/multi-threaded-splash-screen-in-c/48946#48946 using (SplashForm splashForm = new SplashForm()) { splashForm.Show(); while (_showSplash) { Application.DoEvents(); } splashForm.Close(); } }
private static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // load current culture, en-US or zh-CN // make be can change to configalbe later. Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture; // load resource files MainForm.LocRM = new ResourceManager("WinApt.Client.WinAptStrings", typeof(MainForm).Assembly); SplashForm mySplash = new SplashForm(); bool exitFlag = false; mySplash.Show(); try { //when the fisrt time run this program, exception("new") throws mySplash.InitApp(); } catch (Exception e) { //build new config file. if (e.Message == "new") { ChoseForm myChoseForm = new ChoseForm(); myChoseForm.ShowDialog(mySplash); if (myChoseForm.DialogResult == DialogResult.OK) { myChoseForm.Config(); mySplash.InitApp(); } myChoseForm.Close(); } else { MessageBox.Show(e.Message); exitFlag = true; } } finally { mySplash.Close(); } if (exitFlag) return; Application.Run(new MainForm()); }
/// <summary> /// handles the normal splash screen /// </summary> private void ShowNormalSplash() { frm = new SplashForm(); frm.SetVersion(Version); frm.Show(); frm.Update(); frm.FadeIn(); string oldInfo = null; while (!stopRequested && (frm.Focused || _overlaidForm != null)) //run until stop of splashscreen is requested { if (AllowWindowOverlayRequested) { // Allow other Windows to Overlay the splashscreen lock (_overlaidFormClosingLock) { if (_overlaidForm != null && _overlaidForm.Visible) // prepare everything to let the Outdated skin message appear { if (frm.Focused) { frm.TopMost = false; _overlaidForm.TopMost = true; _overlaidForm.BringToFront(); Cursor.Show(); } } else { AllowWindowOverlayRequested = false; frm.TopMost = true; frm.BringToFront(); Cursor.Hide(); } } } if (oldInfo != info) { frm.SetInformation(info); oldInfo = info; } Thread.Sleep(25); //Application.DoEvents(); } frm.FadeOut(); frm.Close(); //closes, and disposes the form frm = null; }
static void Main(string[] args) { //高Dpi設定 if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Thread to show splash window Thread thUI = new Thread(new ThreadStart(ShowSplashWindow)) { Name = "Splash UI", Priority = ThreadPriority.Highest, IsBackground = true }; thUI.Start(); //Thread to load time-consuming resources. Thread th = new Thread(new ThreadStart(LoadResources)) { Name = "Resource Loader", Priority = ThreadPriority.Normal }; th.Start(); th.Join(); if (SplashForm != null) { SplashForm.Invoke(new MethodInvoker(delegate { SplashForm.Close(); })); } thUI.Join(); if (args.Length == 0) { Application.Run(new Form1()); } else { Application.Run(new Form1(args[0].ToString())); } }
public static void Start() { SplashForm splashForm = new SplashForm(); try { Global.SplashForm = splashForm; splashForm.Show(); UIHelper.LoadSavedDataFromJsonFiles(); splashForm.Close(); } catch (Exception e) { Console.WriteLine(e.Message); Helper.Log(e.Message, "LoadingSavedData"); } Application.Run(new ETLParent()); }
static void Main() { // Old .net versions //Application.SetHighDpiMode(HighDpiMode.SystemAware); //Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); // new in .net 6 ApplicationConfiguration.Initialize(); ApplicationContext applicationContext = new ApplicationContext(); Store appStore = new Store(new FactoryViewsWinForms()); #region Splash SplashForm splashForm = new SplashForm(appStore); splashForm.Show(); Application.DoEvents(); #endregion LoadAppStore(appStore); #region Demo & lab // applicationContext.MainForm = new LabForm(appStore); #endregion #region Normal start var knoteManagment = new KNoteManagmentComponent(appStore); knoteManagment.Run(); applicationContext.MainForm = (Form)knoteManagment.View; #endregion splashForm.Close(); Application.Run(applicationContext); }
public static void CloseSplash(SplashTypeOfMessage typeOfMessage, string message, bool itWasrinvoked) { CloseSplashHandler closeSpalshHandler = new CloseSplashHandler(CloseSplash); bool launched = false; while (!launched && !itWasrinvoked) { lock (SplashForm.locker) { if (!SplashForm.WaitPlease) { launched = true; } } } if (_splashForm != null && _splashThread != null) { if (_splashForm.InvokeRequired) { _splashForm.Invoke(closeSpalshHandler, new object[] { typeOfMessage, message, true }); } else { switch (typeOfMessage) { case SplashTypeOfMessage.Warning: break; case SplashTypeOfMessage.Error: MessageBox.Show("Error"); break; default: break; } _splashForm.Close(); _splashThread = null; } } }
public void Start(IBundleContext context) { var splashForm = new SplashForm(Resources.Splashscreen); splashForm.Show(); context.AddService(typeof(IWPFUIElementAdapter), new WPFUIElementAdapter()); var layoutView = new ShellLayoutView(); context.AddService <IWorkspace>(layoutView.Workspace); context.AddService(layoutView.CreateShellLayoutViewProxy()); var form = new ShellForm(); context.AddService <Form>(form); form.ShowLayoutIvew(layoutView); form.Activated += (sender, e) => splashForm.Close(); }
/// <summary> /// Starts the actual splash screen. /// </summary> /// <remarks> /// This method is started in a background thread by the <see cref="Run"/> method.</remarks> private void DoRun() { string oldInfo = null; frm = new SplashForm(); frm.SetVersion(Version); frm.Show(); frm.Update(); frm.FadeIn(); while (!stopRequested && (frm.Focused || _allowOverlay)) //run until stop of splashscreen is requested { if (_allowOverlay == true && _hintForm != null) // Allow other Windows to Overlay the splashscreen { if (_hintForm.Visible) // prepare everything to let the Outdated skin message appear { if (frm.Focused) { frm.TopMost = false; _hintForm.TopMost = true; _hintForm.BringToFront(); } } else { _allowOverlay = false; frm.TopMost = true; frm.BringToFront(); } } if (oldInfo != info) { frm.SetInformation(info); oldInfo = info; } Thread.Sleep(25); } frm.FadeOut(); frm.Close(); //closes, and disposes the form frm = null; }
public void RunApplication() { // This will show the splash screen ThreadPool.QueueUserWorkItem(new WaitCallback(MessageLoopThread)); // This will perform any miscellaneous loading functions splashForm.PerformLoadingFunctions(); if (!CheckLicensing()) { ShowErrorMessage(); Application.Exit(); return; } // Now load the main form mainForm = new MainForm(); // We're done loading! Swap out our objects base.MainForm = mainForm; // Close our splash screen splashForm.Close(); splashForm.Dispose(); splashForm = null; }
private void SharpClientForm_Load(object sender, System.EventArgs e) { try { psStatusBar.Panels[0].Icon=this.Icon; psStatusBar.Panels[0].Text="Welcome to ProfileSharp. The .NET Code, Performance and Memory Profiler by SoftProdigy."; Application.DoEvents(); splashForm=new SplashForm(); splashForm.Show(); Application.DoEvents(); this.Cursor =Cursors.WaitCursor ; Application.DoEvents(); try { Configurator.RestoreDefaultConfiguration(); } catch{} try { FunctionImporter.DeleteCache("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Application.StartupPath+@"\SharpBase.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=False;",true); } catch{} try { ObjectImporter.DeleteCache("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Application.StartupPath+@"\SharpBase.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=False;",true); } catch{} Application.DoEvents(); if(CanCompact()) { CompactDB(); } System.Threading.Thread.Sleep(3000); } catch { if(splashForm!=null) { try { splashForm.Close(); splashForm.Dispose(); splashForm=null; Application.DoEvents(); } catch{} } } finally { this.Cursor=Cursors.Arrow ; SharpClientForm.scInstance.AddStackControlTab("Profiler-Options","Profiler-Options",12,SharpClient.UI.Docking.State.DockLeft,"Choose an option","Profile desktop application.||Profile windows service.||Profile ASP.NET||Profile COM+ application.||Open performance results.||Open memory results.||Compare two memory snapshots.||Report a bug.||Suggest a feature.||Ask for a customization.||View help file.||ProfileSharp license agreement.||Check for updates.||About us.","\nPlease choose an action to perform\nwith ProfileSharp." ,-1,true,false); if(splashForm!=null) { try { splashForm.Close(); splashForm.Dispose(); splashForm=null; Application.DoEvents(); } catch{} } } /////////Auto Attach Start Thread Application.DoEvents(); profileeThread = new System.Threading.Thread(new System.Threading.ThreadStart(refreshProcessView)); profileeThread.Start(); ////////////////// if (SharpClientForm.arguments!=null && SharpClientForm.arguments.Length>0) { try { foreach (string fileName in SharpClientForm.arguments) { Application.DoEvents(); if(fileName.ToLower().EndsWith(".oxml")) { SharpClientTabPage objectTab=new SharpClientTabPage("Loading...",fileName ); objectTab.Dock =DockStyle.Fill ; this.sharpClientMDITab.TabPages.Add(objectTab); this.sharpClientMDITab.SelectedTab =objectTab ; objectTab.Show(); } else if(fileName.ToLower().EndsWith(".fxml")) { SharpClientTabPage functionTab=new SharpClientTabPage("Loading...",fileName ); functionTab.Dock =DockStyle.Fill ; this.sharpClientMDITab.TabPages.Add(functionTab); this.sharpClientMDITab.SelectedTab =functionTab ; functionTab.Show(); } Application.DoEvents(); break;//we only want to open 1 file at a time. } } catch(Exception except) { MessageBox.Show("ProfileSharp was unable to open one or more files specified.\n"+except.Message,"Error!",MessageBoxButtons.OK,MessageBoxIcon.Error) ; } } }
internal static void Launch() { Application.CurrentCulture = CultureInfo.InvariantCulture; Application.EnableVisualStyles(); //Application.SetCompatibleTextRenderingDefault(false); splash = new SplashForm(); splash.Show(); Timer timer = new Timer(); //Configure this timer to restart each second ( 1000 millis) timer.Interval = 1000; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); timer.Start(); //splash.Refresh(); //Application.DoEvents(); Application.DoEvents(); MainModule.Initialize("data"); splash.SetLoadProgress(50); splash.Refresh(); Application.DoEvents(); UpdaterHelper.UpdateInfo info; info = UpdaterHelper.CheckFromUpdates(); Application.DoEvents(); if (info.UpdateAvailable) { UpdateForm updateForm; updateForm = new UpdateForm(info); updateForm.ShowDialog(); Application.DoEvents(); } splash.SetLoadProgress(60); splash.Refresh(); Application.DoEvents(); IconsManager.Initialize(); Application.DoEvents(); MainForm main = new MainForm(); //if (runSingleInstance) //{ // main.HandleCreated += new EventHandler(main_HandleCreated); //} GC.Collect(); timer.Stop(); timer.Close(); splash.SetLoadProgress(100); splash.Refresh(); Application.DoEvents(); splash.Close(); splash = null; Application.DoEvents(); Application.Run(main); }
private void MainForm_Load(object sender, EventArgs e) { bool splash_screen_done = false; try { SplashForm splash_form = new SplashForm(); ThreadPool.QueueUserWorkItem(delegate { using (splash_form) { splash_form.Show(); while (!splash_screen_done) { Application.DoEvents(); } splash_form.Close(); } }, null); splash_form.Version += " - " + Globals.SHORT_VERSION; InitializeControls(); splash_form.Information = "Initializing server ..."; if ((Globals.EDITION == Edition.Grammar) || (Globals.EDITION == Edition.Research)) { splash_form.Information = "Loading grammar information ..."; } splash_form.Progress = 30; Thread.Sleep(100); LoadApplicationFolders(); string machine = "local"; string username = "******"; string password = "******"; string numerology_system_name = null; numerology_system_name = LoadNumerologySystemName(); m_client = new Client(machine, username, password, numerology_system_name); if (m_client != null) { splash_form.Information = "Loading research methods ..."; LoadResearchMethods(); splash_form.Progress = 35; Thread.Sleep(100); splash_form.Information = "Loading translations ..."; PopulateTranslatorsCheckedListBox(); PopulateTranslatorComboBox(); splash_form.Progress = 40; Thread.Sleep(100); splash_form.Information = "Loading tafseers ..."; PopulateTafseerComboBox(); splash_form.Progress = 55; Thread.Sleep(100); splash_form.Information = "Loading recitations ..."; PopulateRecitationsCheckedListBox(); PopulateReciterComboBox(); splash_form.Progress = 60; Thread.Sleep(100); // must be done before LoadApplicationSettings splash_form.Information = "Loading user bookmarks ..."; m_client.LoadBookmarks(); UpdateBookmarkHistoryButtons(); splash_form.Progress = 70; Thread.Sleep(100); splash_form.Information = "Loading application settings ..."; LoadApplicationSettings(); splash_form.Progress = 80; Thread.Sleep(100); splash_form.Information = "Loading numerology systems ..."; PopulateNumerologySystemComboBox(); NumerologySystemComboBox.SelectedIndexChanged -= new EventHandler(NumerologySystemComboBox_SelectedIndexChanged); NumerologySystemComboBox.SelectedItem = numerology_system_name; if (m_client.NumerologySystem != null) { UpdateKeyboard(m_client.NumerologySystem.TextMode); GoldenRatioOrderLabel.Visible = true; GoldenRatioScopeLabel.Visible = true; } NumerologySystemComboBox.SelectedIndexChanged += new EventHandler(NumerologySystemComboBox_SelectedIndexChanged); splash_form.Progress = 85; Thread.Sleep(100); splash_form.Information = "Loading browse history ..."; m_client.LoadHistoryItems(); UpdateBrowseHistoryButtons(); splash_form.Progress = 90; Thread.Sleep(100); splash_form.Information = "Loading help messages ..."; if (m_client.HelpMessages != null) { if (m_client.HelpMessages.Count > 0) { HelpMessageLabel.Text = m_client.HelpMessages[0]; } } splash_form.Progress = 95; Thread.Sleep(100); splash_form.Information = "Generating prime numbers ..."; UpdateFindByTextControls(); splash_form.Progress = 100; Thread.Sleep(100); if (ReciterComboBox.SelectedItem != null) { RecitationGroupBox.Text = ReciterComboBox.SelectedItem.ToString(); } ToolTip.SetToolTip(PlayerVolumeTrackBar, "Volume " + (m_audio_volume / (1000 / PlayerVolumeTrackBar.Maximum)).ToString() + "%"); PopulateChapterSortComboBox(); RefreshCurrentNumerologySystem(); UpdateObjectListView(); FavoriteNumerologySystemButton.Visible = (numerology_system_name != NumerologySystem.FAVORITE_NUMERORLOGY_SYSTEM); SaveAsFavoriteNumerologySystemLabel.Visible = (numerology_system_name != NumerologySystem.FAVORITE_NUMERORLOGY_SYSTEM); RestoreFavoriteNumerologySystemLabel.Visible = (NumerologySystem.FAVORITE_NUMERORLOGY_SYSTEM != NumerologySystem.PRIMALOGY_NUMERORLOGY_SYSTEM); // prepare before Shown this.ClientSplitContainer.SplitterDistance = m_information_box_top; this.TabControl.SelectedIndex = m_information_page_index; switch (Chapter.PinTheKey) { case null: PinTheKeyCheckBox.CheckState = CheckState.Indeterminate; break; case false: PinTheKeyCheckBox.CheckState = CheckState.Unchecked; break; case true: PinTheKeyCheckBox.CheckState = CheckState.Checked; break; } ApplyLoadedWordWrapSettings(); // must be before DisplaySelection for Verse.IncludeNumber to take effect DisplaySelection(false); GrammarTextBox.Text = GRAMMAR_EDITION_INSTRUCTION; this.Activate(); // bring to foreground } } catch { // silence exception } finally { splash_screen_done = true; Thread.Sleep(100); // prevent race-condition to allow splashform.Close() } }
private void MainForm_Load(object sender, EventArgs e) { // do all my expensive loading here _splash.Close(); }
public MainForm(SplashForm splashForm) { InitializeComponent(); InitPreferences(); ActivateLanguage(); GuiObjectsCollection.ApplyActualLanguageFor(this); InitHelpProviderFor(helpProvider, this, "Intro"); InitLinks(); InitCheckedMenuItemsBy(Preferences.Res); InitControllers(Preferences.Res); BindEventsToControls(); BindEventsToMenuItems(); InitDinamicMenuItems(); SetActualController(); SetHelpProviderToControls(); splashForm.Close(); Visible = true; InitControls(Preferences.Res); InitModesTabPagesBy(Preferences.Res); DisplayLicState(); }
private void MainForm_Load(object sender, EventArgs e) { // (optionally) do all my expensive loading here (you may prefer to do it prior to loading the mainform) _splash.Close(); }
private void btnCancel_Click(object sender, EventArgs e) { SplashForm.Close(); }
static private void CloseFormInternal() { splashForm.Close(); }
private void ConnectServer() { Thread t = new Thread(new ThreadStart(ViewerConfig.ConfigureServer)); t.Start(); SplashForm sf = new SplashForm("connect to servers..."); sf.Show(); DateTime startTime = DateTime.Now; while (t.IsAlive == true) { if (DateTime.Now.Subtract(startTime).TotalSeconds >= 6) { t.Abort(); break; } sf.Update(); Thread.Sleep(100); } sf.Close(); }