title: it didn't work on visual studio 2010, why?? Object Reference not set to an Instance of an object
body: <pre><code>private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
  {        
      try
      {
          Customer cust = (Customer)listBox1.SelectedItem;
          //MessageBox.Show("Birth Date: " + textBox1.Text);
          textBox1.Text = cust.FirstName.ToString();
          textBox2.Text = cust.Number.ToString();
          textBox3.Text = cust.Email.ToString();
      }
  
     catch { }
   }
  </code></pre>
  
  <p>The error : </p>
  
  <blockquote>
    <p>Object Reference not set to an Instance of an object</p>
  </blockquote>