
Optimizing, Debugging, and Testing • Chapter 11 533
2. Run the application by selecting Start from the Debug menu.
3. Place an alpha character in the first textbox and select to multiply it by
any number in the right text box.
4. Select Calculate.
You will see that an exception is thrown in the Button1_Click() method.This
exception (System.FormatException) occurred because, as we know, we cannot
convert a string with alpha characters into an integer.We have two ways we can
handle this.We can use a Try…Catch…Finally block and handle the exception, or
we can configure how the compiler should handle this exception.This type of
configuration is done in the Exceptions ...