I've got a Windows Form with some wrong code inside (no matter what the errors are, they are on purpose to check the exceptions raised).
Remember I'm not using any try-catch
, not inside the form, nor outside. I'm just expecting debugger throws exception and stops running.
When I show the form using ShowDialog()
, exceptions are thrown with no problem.
When I show the form using Show()
, no exceptions are raised. The error occurs during code execution, the code interrupts running where exception should be raised, but form keeps active and functional, accepting clicks and running all events fine. Shouldn't the debugger throw the exceptions raised by the form???
Is that normal??? The Show()
method was really meant not to throw exeptions???
Or is that some weird bug from the form being in an Autocad Plug-in???
Some code (I think it's useless, but there it goes)
public void ShowMyForm(MyForm MyFormInst)
{ MyFormInst.Show(); } //here, the form doesn't raise exceptions when I click button1.
public void ShowMyFormModal(MyForm MyFormInst)
{ MyFormInst.ShowDialog(); } //here, the form raises exceptions when I click button1.
class MyForm : Form
{
//initialize and blablabla
private void button1_Click(object sender, EventArgs e)
{
double[] Arrr = new double[] {1, 2, 3};
double Numb = Arrr[4]; //yes, did this on purpose to force exceptions.
}
}