Question: I have such piece of code:

```
    private void button1_Click(object sender, EventArgs e) {
        // Do something...
    }

    private void Form1_KeyDown(object sender, KeyEventArgs e) {
        if (e.KeyData == Keys.A) {
            // Call button1_Click.
        }
    }

```

How do I manage to call the Click event? What should I write instead of

```
            // Call button1_Click.

```

Thank you!

Answer: 
Events are meant to be triggered not called. So you can trigger the event in your `Form1_KeyDown` event by performing the button click. I mean

```
    private void Form1_KeyDown(object sender, KeyEventArgs e) {
            if (e.KeyData == Keys.A) {
                button1.PerformClick();
            }
    }

```
Since the button click event handler is just a method, you could just do:

```
private void Form1_KeyDown(object sender, KeyEventArgs e) {
    if (e.KeyData == Keys.A) {
        button1_Click(this, e);
    }
}

```

However, it's often a better idea to move the *logic* into a separate method, and call it from both locations. By refactoring the logic within `button1_Click` into it's own method, you make it clear that you're calling that logic from either set of event handlers.