Visual basic case statements11/12/2022 LISTING 9.1 09LIST01.TXT-Making Decisions Based on the Value of an To the Book Info page for Using Visual Basic 6. The source code for this program is the project simplclc.vbp, which is availableīe asked to enter an ISBN enter 078971633x and then click the Search button to go Listing 9.1 shows the entire code for the event procedure for the click of theĬmdOperation CommandButton, the button that users click to perform the selected math If optAddition.Value = True Then z = x + y Performs the associated math operation if True and is an example of a single-line The following shows the If statement from the program. Property of an OptionButton is set to True, the program does the associated math Of the Value property of the OptionButton assigned to each operation. The program decides which math operation to perform by evaluating the setting On the numbers and displays the result in a third TextBox.Ĭalculator makes decisions in an If.Then statement, based on the value of the OptionButton. The program performs the selected math operation Is that you enter a number in each of the two upper TextBoxes, select a math operation,Īnd then click the CommandButton. Look at the Simple Calculator program in Figure 9.1. ThisĬan be any valid Visual Basic statement other than a variable declaration. The command represents the task to be performed if the condition is True.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |