title: Why am I not able to access the KeyCode member of System.EventArgs?
body: <p>What am I doing wrong? Here is the error code that I get:</p>
  
  <blockquote>
    <p>'System.EventArgs' does not contain a definition for 'KeyCode' and no extension method 'KeyCode' accepting a first argument of type 'System.EventArgs' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Windows.Forms;
  
  namespace BroZer
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          private void Reload_Click(object sender, EventArgs e)
          {
              webBrowser1.Refresh();
          }
  
          private void Go_Click(object sender, EventArgs e)
          {
              webBrowser1.Navigate(textBox1.Text);
          }
  
          private void Back_Click(object sender, EventArgs e)
          {
              webBrowser1.GoBack();
          }
  
          private void Forward_Click(object sender, EventArgs e)
          {
              webBrowser1.GoForward();
          }
  
          private void textBox1_KeyDown(object sender, EventArgs e)
          {
              if (e.KeyCode == Keys.Enter)
              {
                  webBrowser1.Navigate("https://www.google.com/search?&amp;ie=UTF-8&amp;q=" + textBox1.Text);
              }
          }
  
          private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
          {
  
          }
  
          private void Save_Click(object sender, EventArgs e)
          {
              webBrowser1.ShowSaveAsDialog();
          }
  
          private void Print_Click(object sender, EventArgs e)
          {
              webBrowser1.ShowPrintPreviewDialog();
          }
      }
  }
  </code></pre>