10.1 Use Try…Catch…Finally to handle unexpected as well as anticipated exceptions.
Most exception handlers are designed to trap exceptions that aren’t anticipated at design time. Use a Try…Catch…Finally structure to catch all unanticipated exceptions.
Private Sub btnSelectPicture_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles _ btnSelectPicture.Click ’ Purpose : Open the selected picture and display it in the ’ picture box. ’ Show the open file dialog box. If ofdSelectPicture.ShowDialog = DialogResult.OK Then ’ Load the picture into the picture box. picShowPicture.Image = Image.FromFile(ofdSelectPicture.FileName) ...