Scenario is:
- I have a button called
X
in project A One of the events for
X
is the following:private void X_KeyDown(object sender, KeyEventArgs e) {//if the user presses Ctrl + V if (e.KeyCode == Keys.Control && e.KeyCode == Keys.V) { MessageBox.Show("hello"); } }
I've now created a new poject B and added a button to a form and also called it
X
. I then copied the above code intoForm1.cs
.
Question: If I go to form B and select the button and then double click the KeyDown
event it does not go to the code I copied in but creates the following. Why ?
private void X_KeyDown_1(object sender, KeyEventArgs e)
{
}