title: Object reference not set to an instance of an object
body: <p>I have this function that create runtime textbox:</p>
  
  <pre><code>int i = 0;
  private TextBox[] addressBox = new TextBox[100];
  
  private void appendNewTab()
  { 
      addressBox[i] = new TextBox();
      addressBox[i].KeyPress += 
          new KeyPressEventHandler(this.addressBox_KeyPress); 
      i++;
  }
  
  void addressBox_KeyPress(object sender, KeyPressEventArgs e)
  {
      if (e.KeyChar == (char)13)
      {
          MessageBox.Show(addressBox[i].Text);
      }
  }
  </code></pre>
  
  <p>but i have Object reference not set to an instance of an object here</p>
  
  <pre><code>MessageBox.Show(addressBox[i].Text);
  </code></pre>
  
  <p>any suggestion?</p>