private void TxtALONTOP_KeyDown(object sender, KeyEventArgs e) { if ((e.KeyCode >= Keys.PageUp && e.KeyCode <= Keys.Home) || (e.KeyCode >= Keys.Insert && e.KeyCode <= Keys.Z) || (e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.F12) || (e.KeyCode >= Keys.OemSemicolon && e.KeyCode <= Keys.OemQuotes)) { e.SuppressKeyPress = true; this.TxtALONTOP.Tag = e.KeyValue; this.TxtALONTOP.Text = FormCommon.ConvertKeyToString(e.KeyCode); } else { e.Handled = true; } }
public override void LoadSettings() { try { string[] settings = Properties.Settings.Default.ALONTOPShortcut.Split('&'); this.ChkALONTOPCtrl.Checked = settings[0].Trim().Equals("1"); this.ChkALONTOPShift.Checked = settings[1].Trim().Equals("1"); this.ChkALONTOPAlt.Checked = settings[2].Trim().Equals("1"); this.TxtALONTOP.Text = FormCommon.ConvertKeyToString((Keys)Int32.Parse(settings[3])); //this.ChkALONTOP.Checked = Properties.Settings.Default.ALONTOEnable; //this.ChkRunAtStatup.Checked = Properties.Settings.Default.RunAtStatupEnable; _registryKey = Registry.CurrentUser.OpenSubKey ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); SetStatupSetting(); } catch (Exception e) { Console.WriteLine(e.Message); MessageBox.Show(Resources.Error001, Resources.TitleError, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); DefaultSettings(); } }