public SettingsForm() { InitializeComponent(); versionInfo.Text = "|Version " + MainProgram.softwareVersion; computerName.KeyDown += new KeyEventHandler(FreakingStopDingSound); fileEditedMargin.KeyDown += new KeyEventHandler(FreakingStopDingSound); fileReadDelay.KeyDown += new KeyEventHandler(FreakingStopDingSound); void FreakingStopDingSound(Object o, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { e.Handled = true; e.SuppressKeyPress = true; } } //Set values startWithWindows.Checked = MainProgram.ACCStartsWithWindows(); checkUpdates.Checked = Properties.Settings.Default.CheckForUpdates; betaProgram.Checked = Properties.Settings.Default.BetaProgram; warnDeletion.Checked = Properties.Settings.Default.WarnWhenDeletingManyFiles; defaultComputer.Checked = Properties.Settings.Default.DefaultComputer; computerName.Text = Properties.Settings.Default.ComputerName; fileEditedMargin.Value = (decimal)Properties.Settings.Default.FileEditedMargin; fileReadDelay.Value = (decimal)Properties.Settings.Default.FileReadDelay; maxDeleteFiles.Value = Properties.Settings.Default.MaxDeleteFiles; maxDeleteFiles.Enabled = warnDeletion.Checked; infoTooltip.SetToolTip(betaProgram, "Receive updates on new beta versions (often unstable, experimental builds)"); mainPanel.Click += delegate { mainPanel.Focus(); }; //On change //Has to be down & up, otherwise the last character isn't appended for some reason computerName.KeyDown += delegate { Properties.Settings.Default.ComputerName = computerName.Text; Properties.Settings.Default.Save(); }; computerName.KeyUp += delegate { Properties.Settings.Default.ComputerName = computerName.Text; Properties.Settings.Default.Save(); }; fileEditedMargin.ValueChanged += delegate { Properties.Settings.Default.FileEditedMargin = (float)fileEditedMargin.Value; Properties.Settings.Default.Save(); }; fileReadDelay.ValueChanged += delegate { Properties.Settings.Default.FileReadDelay = (float)fileReadDelay.Value; Properties.Settings.Default.Save(); }; maxDeleteFiles.ValueChanged += delegate { Properties.Settings.Default.MaxDeleteFiles = (int)maxDeleteFiles.Value; Properties.Settings.Default.Save(); }; /* Translations */ int i = 0; string activeLanguage = Properties.Settings.Default.ActiveLanguage; foreach (string item in Translator.languagesArray) { programLanguage.Items.Add(item); if (activeLanguage == item) { programLanguage.SelectedIndex = i; } ++i; } Text = Translator.__("window_name", "settings"); foreach (Control x in this.Controls) { Translator.TranslateWinForms("settings", x.Controls); } }