private void trainningForm_KeyPress(object sender, KeyPressEventArgs e) { if (isNoSelectedMusic() && e.KeyChar.ToString() != "\0") { try { string input = e.KeyChar.ToString().ToUpper(); keyntValue key = (keyntValue)Enum.Parse(typeof(keyntValue), input); ntValue notevalue = key.keyTontValue(); ntkrValue notename = key.keyTontkrValue(); lb_note.Text = notename.ToString(); if (trainningmode(notevalue, POtrCtr.ocIndex, POtrCtr.basicIndex) == true) { POtrCtr.note_location(notevalue, p_trmusic); POtrCtr.note_sound(POtrCtr.ocIndex, (int)notevalue); } } catch (Exception err) { MessageBox.Show("해당키만 누르시오!" + err.Message); } e.KeyChar = '\0'; } }
//기미녕이 한부분 private void Form1_KeyPress_1(object sender, KeyPressEventArgs e) { if (!tb_name[0].Enabled && POctl.checkingMaxNode() && e.KeyChar.ToString() != "\0") // "제목입력" 상태의 버튼일 경우 { try { if (e.KeyChar == (char)13) { return; } string input = e.KeyChar.ToString().ToUpper(); keyntValue key = (keyntValue)Enum.Parse(typeof(keyntValue), input); ntValue notevalue = key.keyTontValue(); POctl.note_location(notevalue, p_music[POctl.now_music.smind]); POctl.note_locationInMadi(notevalue, p_madi[POctl.now_music.smind]); POctl.note_sound(POctl.ocIndex, (int)notevalue); } catch (Exception err) { MessageBox.Show("해당키만 누르시오!" + err.Message); } e.KeyChar = '\0'; } }