6.3.7.6.3 Develop Additional Code to Coordinate theImage Display
Open the Design View of our FacultyFrame Form by clicking on the Design tab from the top of the window, and double-click on the Select button to open its event handler. Add the code in bold in Figure 6.37 into this handler.

FIGURE 6.37 The new added code to the Select button Click event handler.
Let’s have a closer look at the new added code to see how it performs.
A. A try-catch block pair is used for the faculty image-displaying operation. First, the user method ShowFaculty() is called with the selected faculty image, fimgBlob, as the argument to pick up and display the selected faculty image in the Canvas. This method should return a Boolean value to indicate whether it executes successfully. A true means that the method executed successfully; otherwise, a returned false means that the method failed, and that is displayed in our MsgDialog.
B. The catch block is used to monitor any possible SQLException or IOException during the execution of this user-defined method and to log them into a log file.
The final coding job for the FacultyFrame class is the Back button Click event handler. This code is very easy; the FacultyFrame object should be closed and disposed when the user clicks on this button, and control should be directed back to the SelectionFrame Form to allow the user to continue selecting other functions.
6.3.7.7 Develop the Code for the Back Button Click Event Handler
The coding process for this event handler is simple. The FacultyFrame Form window should be closed and removed from the screen when this button is clicked by the user. Open the Back button Click event handler and enter the code shown in Figure 6.38 into this event handler.