Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tutorial 12 – Security Panel Application Introducing the Select Case Multiple-Selection Statement Outline 12.1 Test-Driving the Security Panel Application.

Similar presentations


Presentation on theme: "Tutorial 12 – Security Panel Application Introducing the Select Case Multiple-Selection Statement Outline 12.1 Test-Driving the Security Panel Application."— Presentation transcript:

1 Tutorial 12 – Security Panel Application Introducing the Select Case Multiple-Selection Statement
Outline 12.1 Test-Driving the Security Panel Application Introducing the Select Case Multiple-Selection Statement Constructing the Security Panel Application Wrap-Up

2 In this tutorial, you will learn to:
Objectives In this tutorial, you will learn to: Use the Select Case multiple-selection statement. Use Case statements. Use the Is keyword. Display a date and time. Use TextBox property PasswordChar.

3 12.1 Test-Driving the Security Panel Application

4 12.1 Test-Driving the Security Panel Application
Load the Wage Calculator application Debug > Start

5 12.1 Test-Driving the Security Panel Application
Figure 12.1 Security Panel application executing. TextBox Keypad Output ListBox

6 12.1 Test-Driving the Security Panel Application
Figure 12.2 Asterisks displayed in Security code: field. An asterisk is displayed for each numeric key pressed

7 12.1 Test-Driving the Security Panel Application
Entering invalid code Enter 1212 Click # Button

8 12.1 Test-Driving the Security Panel Application
Figure 12.3 Security Panel displaying Access Denied message. Message indicating that an invalid security code was entered

9 12.1 Test-Driving the Security Panel Application
Entering valid code Enter 1006 Click # Button

10 12.1 Test-Driving the Security Panel Application
Figure 12.4 Security Panel application confirming a valid security-code entry. Message displayed when a valid security code is entered

11 12.2 Introducing the Select Case Multiple-Selection Statement
Select Case statement Begins with keywords Select Case followed by test expression Can contain optional Case Else statement Terminates with keywords End Select

12 12.2 Introducing the Select Case Multiple-Selection Statement
Figure 12.5 Select Case multiple-selection statement UML activity diagram.

13 12.3 Constructing the Security Panel Application

14 12.3 Constructing the Security Panel Application

15 12.3 Constructing the Security Panel Application
Figure 12.7 Variable declarations for btnEnter_Click. Declaring event handler’s variables Declaring variables Clearing the TextBox

16 12.3 Constructing the Security Panel Application
Creating Case statement Specify a range of values using: Keyword Is Comparison operator (in this case, <)

17 12.3 Constructing the Security Panel Application
Figure 12.8 Select Case statement. Creating a Select Case statement Create Select Case statement Set controlling expression

18 12.3 Constructing the Security Panel Application
Figure 12.9 First Case added to Select Case statement. Is keyword can be used for relational and equality comparisons

19 12.3 Constructing the Security Panel Application
Creating a Case statement Specifying a range of values using: Keyword To Checking for a specific number Specifying multiple expressions Use a comma to separate expressions

20 12.3 Constructing the Security Panel Application
Figure 12.10 Cases specified for remaining access codes. To keyword can be used to specify a range of values to test. Comma used to separate multiple expressions in a Case

21 12.3 Constructing the Security Panel Application
Creating a Case Else statement Use keywords Case Else Must follow all other Case statements

22 12.3 Constructing the Security Panel Application
Figure 12.11 Case Else of the Select Case statement. Case Else statement executes when no other case matches

23 12.3 Constructing the Security Panel Application
Date structure Stores and displays date and time information Property Now returns: System time as a Date

24 12.3 Constructing the Security Panel Application
Figure 12.12 Updating the Security Panel application’s ListBox.

25 12.3 Constructing the Security Panel Application
Figure 12.13 Event handler btnZero_Click. Appending “0” to the end of a String

26 12.3 Constructing the Security Panel Application
Figure 12.14 Event handlers btnOne_Click and btnTwo_Click. Appending “1” and “2” to the end of a String

27 12.3 Constructing the Security Panel Application
Figure 12.15 Event handler btnClear_Click defined. Clearing the TextBox

28 Using a Select Case statement to determine user access level
SecurityPanel.vb (1 of 5) Declaring variables Retrieving access code and clearing TextBox Using a Select Case statement to determine user access level

29 SecurityPanel.vb (2 of 5) Appending the numeric Button value to the text stored in the TextBox

30 SecurityPanel.vb (3 of 5)

31 SecurityPanel.vb (4 of 5)

32 SecurityPanel.vb (5 of 5) Clearing the TextBox


Download ppt "Tutorial 12 – Security Panel Application Introducing the Select Case Multiple-Selection Statement Outline 12.1 Test-Driving the Security Panel Application."

Similar presentations


Ads by Google