title: C# ListBox_SelectedIndexChanged is like try-catch
body: <p>When there is an exception in <code>ListBox_SelectedIndexChanged</code>, the program jumps out of the method, like I would write code in try-catch block.</p>
  
  <p>Here is an example:</p>
  
  <pre><code>private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
  {
      int x = int.Parse("test"); //this should crash the program
  }
  </code></pre>
  
  <p>This works fine, in this case it crashes program</p>
  
  <pre><code>private void listBox1_Click(object sender, EventArgs e)
  {
      int x = int.Parse("test");
  }
  </code></pre>
  
  <p>This is happening only when I run program in VS. When I run it from Explorer, it crashes every time.</p>
  
  <p>Do you know why?</p>