Ejemplo n.º 1
0
        private void cbOctaveHigh_SelectedIndexChanged(object sender, EventArgs e)
        {
            var tmpSelection = cbOctaveLower.Text;


            switch (cbOctaveHigher.Text)
            {
            case "Ctrl":
                KeyBinding.SetCtrlKeyToNote(OCTAVE_KEY_HIGH, Keys.ControlKey);
                break;

            case "Alt":
                KeyBinding.SetCtrlKeyToNote(OCTAVE_KEY_HIGH, Keys.Menu);
                break;

            case "Shift":
                KeyBinding.SetCtrlKeyToNote(OCTAVE_KEY_HIGH, Keys.ShiftKey);
                break;

            default:
                break;
            }

            var tmpDataSource = new List <string> {
                "Ctrl", "Alt", "Shift"
            };

            tmpDataSource.Remove(cbOctaveHigher.Text);
            cbOctaveLower.SelectedIndexChanged -= cbOctaveLow_SelectedIndexChanged;
            cbOctaveLower.DataSource            = tmpDataSource;
            cbOctaveLower.SelectedItem          = tmpSelection;
            cbOctaveLower.SelectedIndexChanged += cbOctaveLow_SelectedIndexChanged;
        }
Ejemplo n.º 2
0
        private void comboBoxLow_SelectedIndexChanged(object sender, EventArgs e)
        {
            var tmpSelection = comboBox1.SelectedItem.ToString();

            switch (comboBoxLow.SelectedItem.ToString())
            {
            case "Ctrl":
                KeyBinding.SetCtrlKeyToNote(59, Keys.ControlKey);
                break;

            case "Alt":
                KeyBinding.SetCtrlKeyToNote(59, Keys.Alt);
                break;

            case "Shift":
                KeyBinding.SetCtrlKeyToNote(59, Keys.ShiftKey);
                break;

            default:
                break;
            }

            var tmpDataSource = new List <string> {
                "Ctrl", "Alt", "Shift"
            };

            tmpDataSource.Remove(comboBoxLow.SelectedItem.ToString());
            comboBox1.SelectedIndexChanged -= comboBox1_SelectedIndexChanged;
            comboBox1.DataSource            = tmpDataSource;
            comboBox1.SelectedItem          = tmpSelection;
            comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged;
        }