Пример #1
0
        private void TextBoxKeyShortcut_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key >= Key.A && e.Key <= Key.Z ||
                AcceptKeys.Contains(e.Key))
            {
                if (HasKeyDuplicate(e.Key) == false)
                {
                    KeysList.Add(e.Key);
                    if (!string.IsNullOrEmpty(TextBoxKeyShortcut.Text))
                    {
                        TextBoxKeyShortcut.Text += " + ";
                    }
                    TextBoxKeyShortcut.Text += e.Key.ToString();
                }
            }

            e.Handled = true;
        }