title: c# - Form does not contain a definition for btnCalc_Click and no method extension
body: <p>I am wanting to put Event KeyDown for when the user. Click on one button of the KeyBoard, and it will do something.</p>
  
  <p>But It's not working, it says that my Form does not contain a definition for the <strong>button(btnCalc_Click)</strong> and <strong>no method extension</strong>.</p>
  
  <p>My code is :</p>
  
  <pre><code>  private void Form1_KeyDown(object sender, KeyEventArgs e)
          {
  
              if (e.KeyCode == Keys.Delete)
              {
                  if (btnLimpar.Enabled)
                  {  
                      btnLimpar.PerformClick();
                  }
                  else
                  {  
                      this.btnLimpar_Click(null, new EventArgs());
                  }
              }
  
              if (e.KeyCode == Keys.End)
              {
                  if (btnCalcular.Enabled)
                  {
                      btnCalcular.PerformClick();
                  }
                  else
                  {
                      this.btnCalcular_Click(null, new EventArgs());
                  }
  
              }
  
          }
  </code></pre>
  
  <p>It get's wrong in the code : <code>this.btnCalcular_Click(null, new EventArgs());</code></p>
  
  <blockquote>
    <blockquote>
      <p><strong>Error:</strong> FormularioHospital.Form1' does not contain a definition for 'btnCalcular_Click' and no extension method 'btnCalcular_Click' accepting a first argument of type 'FormularioHospital.Form1' could be found.
      `</p>
    </blockquote>
  </blockquote>