P
PromisedOyster
I would like to be able to trap all exceptions that may occur in a form
whilst a windows form is in scope. Once the exception is trapped I want
to output a log line, close the form down and then allow the user to
continue using the application.
frm2 frm1 = new frm1.Show();
frm2 frm2 = new frm2.Show();
public class frm1: MyForm
{
}
public class frm2: MyForm
{
}
public class MyForm: System.Windows.Form
{
public MyForm()
{
try
{
}
catch
{
// output log line
}
}
}
The above example will catch any exceptions in the constructor but not
any once the form is loaded.
whilst a windows form is in scope. Once the exception is trapped I want
to output a log line, close the form down and then allow the user to
continue using the application.
frm2 frm1 = new frm1.Show();
frm2 frm2 = new frm2.Show();
public class frm1: MyForm
{
}
public class frm2: MyForm
{
}
public class MyForm: System.Windows.Form
{
public MyForm()
{
try
{
}
catch
{
// output log line
}
}
}
The above example will catch any exceptions in the constructor but not
any once the form is loaded.