Esempio n. 1
0
 private void btnKeyboardConnect_Click(object sender, EventArgs e)
 {
     if (cbMidiKeyboard.SelectedItem != null)
     {
         if (cbMidiKeyboard.Enabled)
         {
             if (KeyboardUtilities.Connect(cbMidiKeyboard.SelectedIndex) == 0)
             {
                 cbMidiKeyboard.Enabled             = false;
                 btnKeyboardConnect.BackgroundImage = Resources.btn2;
             }
         }
         else
         {
             KeyboardUtilities.Disconnect();
             cbMidiKeyboard.Enabled             = true;
             cbMidiKeyboard.DataSource          = KeyboardUtilities.GetKeyboardList();
             btnKeyboardConnect.BackgroundImage = Resources.btn1;
         }
     }
 }
Esempio n. 2
0
 private void btnKeyboardConnect_Click(object sender, EventArgs e)
 {
     if (cbMidiKeyboard.SelectedItem != null)
     {
         if (cbMidiKeyboard.Enabled)
         {
             if (KeyboardUtilities.Connect(cbMidiKeyboard.SelectedItem.ToString(), kc) == 0)
             {
                 cbMidiKeyboard.Enabled       = false;
                 btnKeyboardConnect.BackColor = Color.Aquamarine;
             }
         }
         else
         {
             KeyboardUtilities.Disconnect();
             cbMidiKeyboard.Enabled       = true;
             cbMidiKeyboard.DataSource    = KeyboardUtilities.GetKeyboardList();
             btnKeyboardConnect.BackColor = Color.FromArgb(255, 110, 128);
         }
     }
 }