private void SetHotKeyFormFromSetting(GLOBAL_HOT_KEY_TYPE type, CheckBox alt_box, CheckBox cntrl_box, CheckBox shift_box, CheckBox win_box, TextBox txt_box) { var setting = broker.GetHotKeySetting(type); alt_box.IsChecked = setting.modifiers.HasFlag(UnManaged.KeyModifier.Alt); shift_box.IsChecked = setting.modifiers.HasFlag(UnManaged.KeyModifier.Shift); cntrl_box.IsChecked = setting.modifiers.HasFlag(UnManaged.KeyModifier.Ctrl); win_box.IsChecked = setting.modifiers.HasFlag(UnManaged.KeyModifier.Win); var key_char = setting.key.ToString(); if (setting.key == System.Windows.Input.Key.None) { key_char = ""; } key_char = key_char.Replace("NumPad", "").Replace("Oem", ""); if (key_char.Length == 2) { key_char = key_char.Replace("D", ""); } if (key_char.Length > 1) { key_char = ""; } txt_box.Text = key_char; }