public void SaveSettings() { try { var with_1 = frmMain.defaultInstance; var windowPlacement = new Tools.WindowPlacement(frmMain.defaultInstance); if (with_1.WindowState == FormWindowState.Minimized && windowPlacement.RestoreToMaximized) { with_1.Opacity = 0; with_1.WindowState = FormWindowState.Maximized; } Settings.Default.MainFormLocation = with_1.Location; Settings.Default.MainFormSize = with_1.Size; if (with_1.WindowState != FormWindowState.Normal) { Settings.Default.MainFormRestoreLocation = with_1.RestoreBounds.Location; Settings.Default.MainFormRestoreSize = with_1.RestoreBounds.Size; } Settings.Default.MainFormState = with_1.WindowState; Settings.Default.MainFormKiosk = frmMain.defaultInstance.fullscreenManager.FullscreenActive; Settings.Default.FirstStart = false; Settings.Default.ResetPanels = false; Settings.Default.ResetToolbars = false; Settings.Default.NoReconnect = false; Settings.Default.ExtAppsTBShowText = with_1.cMenToolbarShowText.Checked; Settings.Default.ConDefaultPassword = Security.Crypt.Encrypt(Settings.Default.ConDefaultPassword, AppInfo.General.EncryptionKey); //Placeholder: Add new toolbar here Settings.Default.msMain = ToolStripConfig.FromPanel(with_1.msMain).ToXMLString(); Settings.Default.tsQuickConnect = ToolStripConfig.FromPanel(with_1.tsQuickConnect).ToXMLString(); Settings.Default.tsQuickTexts = ToolStripConfig.FromPanel(with_1.tsQuickTexts).ToXMLString(); Settings.Default.tsExternalTools = ToolStripConfig.FromPanel(with_1.tsExternalTools).ToXMLString(); Settings.Default.ToolStrip1 = ToolStripConfig.FromPanel(with_1.ToolStrip1).ToXMLString(); Settings.Default.Save(); SavePanelsToXML(); SaveExternalAppsToXML(); SaveQuickTextsToXML(); } catch (Exception ex) { Runtime.MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, ("Saving settings failed" + Constants.vbNewLine + Constants.vbNewLine + ex.Message), false); } }