Question: The code in Figure 11-52 executes when a button is clicked on a Windows Form object. Identify what will happen when a single error occurs.
The code in Figure 11-52 executes when a button is clicked on a Windows Form object. Identify what will happen when a single error occurs. What happens if two errors occur at the same time? What happens if three errors occur at the same time?
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 Dim InputError As Boolean = False ' Is student ID entered properly If txtStudentID.MaskFull = False Then MsgBox("Enter your Student ID in the Student ID box",, "Error") txtStudentID.Clear() txtStudent ID.Focus() InputError =True Is student name entered properly ElseIf txtStudentName. TextLength < 1 Or txtStudent Name. Text < "A" Then MsgBox("Enter your name in the Student Name box",, "Error") txtStudentName.Clear() txtStudentName.Focus() InputError =True Is number of units entered properly ElseIf Not IsNumeric(txtNumberOfUnits.Text) Then MsgBox("Enter the units in the Number of Units box", "Error") txtNumberOfUnits.Clear() txtNumberOfUnits. Focus() InputError = True FIGURE 11-52
Step by Step Solution
3.51 Rating (148 Votes )
There are 3 Steps involved in it
If a single error occurs such as the last name not being entered or being nonalp... View full answer
Get step-by-step solutions from verified subject matter experts
