Beispiel #1
0
        private void comboKeys_SelectedIndexChanged(object sender, EventArgs e)
        {
            string keyName = comboKeys.SelectedItem.ToString();
            Keys key = (Keys)Enum.Parse(typeof(Keys), keyName);

            Keys newKeyCombination = key;
            if ((_keyCombination & Keys.Alt) == Keys.Alt)
                newKeyCombination |= Keys.Alt;
            if ((_keyCombination & Keys.Shift) == Keys.Shift)
                newKeyCombination |= Keys.Shift;
            if ((_keyCombination & Keys.Control) == Keys.Control)
                newKeyCombination |= Keys.Control;
            _keyCombination = newKeyCombination;

            lblKeyCombination.Text = _keyCombination.ToExpression();
        }