Keyboard shortcut for a button
问题 In C# (Microsoft Visual Studio 2010), how can I assign a keyboard shortcut to a button such as the following? private void closeButton_Click(object sender, EventArgs e) { // Close the program this.Close(); } I know I can use the "&" character in the button's Text and create an Alt - n shortcut, but I'd like to create a single keypress shortcut, such as c to execute the above. 回答1: KeyDown is your friend ;) For example, if you want the shortcut key A while Shift is pressed, try this: void