C#組合鍵應用(Ctrl+Enter)
阿新 • • 發佈:2019-02-14
private void textbox_KeyDown(object sender, KeyEventArgs e) { // 如果按下組合鍵CTRL+Enter if (e.KeyData == (Keys.Control | Keys.Enter)) { ... } } private void textbox_KeyDown(object sender, KeyEventArgs e) { // 如果按下組合鍵CTRL+R if (e.Control && e.KeyCode == Keys.R) ... } private void textbox_KeyDown(object sender, KeyEventArgs e) { // 如果按下組合鍵CTRL+A if(e.Modifiers == Keys.Control && e.KeyCode == Keys.A) ... }
以上3種都可以