title: Catch exception thrown by another class?
body: <p>I thought I could catch an exception thrown by another class in my project, but I must be doing it wrong.  In the first class, I'm surrounding my call to the other class with a try/catch block:</p>
  
  <pre><code>try
  {    
      ImportPowerPoint.CreateTitle(textBoxPpt.Text, textBoxPkg.Text);
  }
  catch (FormatException ex)
  {
      MessageBox.Show(ex.Message, "ERROR",
      MessageBoxButtons.OK,
      MessageBoxIcon.Warning);
  }
  </code></pre>
  
  <p>In the second class, this is where I'm throwing the exception:</p>
  
  <pre><code>if (!_layoutMap[(int)Layouts.A].ContainsValue(Fields.Title))
      throw new FormatException("Standard (A) Layout does not contain a title.");
  
  if (!_layoutMap[(int)Layouts.A].ContainsValue(Fields.Txt1))
      throw new FormatException("Standard (A) Layout does not contain a txt1.");
  
  if (!_layoutMap[(int)Layouts.A].ContainsValue(Fields.Prompt))
    throw new FormatException("Standard (A) Layout does not contain a prompt.");
  </code></pre>
  
  <p>When I run the program, it breaks immediately where the exception is thrown, instead of displaying the error window that I defined in the try/catch block.  Am I not handling this try/catch correctly?</p>
  
  <p>For clarification, I'm forcing the exception to occur by removing certain pieces from the PowerPoint that I'm parsing.  When the program fails, for instance, because I removed the <code>Title</code> Field, the exception thrown is of type FormatException.  Shouldn't my <code>catch</code> in the calling class handle this?</p>
  
  <p>EDIT: I think I may have found out something that is causing this to happen.  The exception being thrown is in another thread.  So, since it's in another thread, could this mean that this is why my try/catch isn't catching the exception?</p>