Course ILT Using complex selection structures Unit objectives Include radio buttons and check boxes in an interface, create and call a user- defined Sub.

Slides:



Advertisements
Similar presentations
Sub and Function Procedures
Advertisements

Chapter 11: Classes and Objects
Microsoft Visual Basic: Reloaded Chapter Five More on the Selection Structure.
Chapter 7: Sub and Function Procedures
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Eight Sub and Function Procedures.
1.
Chapter 9: Sequential Access Files and Printing
Chapter 5: More on the Selection Structure Programming with Microsoft Visual Basic.NET, Second Edition.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
Using the Visual Basic Editor Visual Basic for Applications 1.
Chapter 7: Sub and Function Procedures
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 3 Tariq Aziz and Kevin Jones.
Tutorial 7: Sub and Function Procedures1 Tutorial 7 Sub and Function Procedures.
Programming with Microsoft Visual Basic th Edition CHAPTER SEVEN SUB AND FUNCTION PROCEDURES.
Programming with Microsoft Visual Basic 2012 Chapter 7: Sub and Function Procedures.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Seven Sub and Function Procedures.
Visual Basic Chapter 1 Mr. Wangler.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Microsoft Visual Basic 2008: Reloaded Fourth Edition
Tutorial 11 Using and Writing Visual Basic for Applications Code
® Microsoft Access 2010 Tutorial 11 Using and Writing Visual Basic for Applications Code.
Chapter 8: Writing Graphical User Interfaces
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Programming with Microsoft Visual Basic 2008 Fourth Edition
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Working with option button, check box, and list box controls Visual Basic for Applications 13.
Graphical User Interfaces Tonga Institute of Higher Education.
1 Week 6 The Repetition Structure. 2 The Repetition Structure (Looping) Lesson A Objectives After completing this lesson, you will be able to:  Code.
Tutorial 6 The Repetition Structure
Chapter 5: More on the Selection Structure Programming with Microsoft Visual Basic 2005, Third Edition.
Microsoft FrontPage 2003 Illustrated Complete Creating a Form.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Chapter 5: More on the Selection Structure
Programming with Microsoft Visual Basic th Edition
1.
1 Week 5 More on the Selection Structure. 2 Nested, If/ElseIf/Else, and Case Selection Structures Lesson A Objectives After completing this lesson, you.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
EVAN’S FAST FOOD VISUAL BASIC 2012 FINAL PROJECT BY: EVAN CHOATE.
Programming with Visual C++: Concepts and Projects Chapter 4B: Selection (Tutorial)
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
Controlling Program Flow with Decision Structures.
Tutorial 81 Field, Record, Data File Field - a single item of information about a person, place, or thing Record - a group of related fields that contain.
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 11 So Many Paths … So Little Time.
Chapter 10 So Many Paths … So Little Time (Multiple-Alternative Selection Structures) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Chapter Five More on the Selection Structure Programming with Microsoft Visual Basic th Edition.
Chapter 6 - Visual Basic Schneider1 Chapter 6 Repetition.
Programming with Visual Basic.NET. Quick Links Program Code The Code Window The Event Procedure Assignment Statements Using AutoList Radio Buttons Buttons.
Visual Basic.NET BASICS Lesson 9 Nested If Statements and Radio Buttons.
Using Forms and Form Elements In Visual Basic.NET.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
Programming with Microsoft Visual Basic 2012 Chapter 14: Access Databases and SQL.
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
TUTORIAL 4 Visual Basic 6.0 Mr. Crone. Pseudocode Pseudocode is written language that is part-code part- English and helps a programmer to plan the layout.
Visual Basic.NET Windows Programming
Chapter 9: Value-Returning Functions
Chapter 1: An Introduction to Visual Basic 2015
Chapter 8: Writing Graphical User Interfaces
Objectives Learn about Function procedures (functions), Sub procedures (subroutines), and modules Review and modify an existing subroutine in an event.
Visual Basic Programming Chapter Four Notes Working with Variables, Constants, Data Types, and Expressions GROUPBOX CONTROL The _____________________________________.
CIS16 Application Development and Programming using Visual Basic.net
CHAPTER FOUR VARIABLES AND CONSTANTS
Presentation transcript:

Course ILT Using complex selection structures Unit objectives Include radio buttons and check boxes in an interface, create and call a user- defined Sub procedure, use the Random object, and process code when a form is loaded into the computer’s memory Select the existing text in a text box control, code a check box control’s Click event procedure, and display and hide a control

Course ILT Topic A Topic A: The Math Practice application Topic B: Completing the Math Practice application

Course ILT Completing the user interface The application should display the addition or subtraction problem on the screen, then allow the student to enter the answer and then verify that the answer is correct If the student’s answer is not correct, the application should give him or her as many chances as necessary to answer the problem correctly

Course ILT Adding a Radio button RadioButton control is used to limit the user to only one choice in a group of options RadioButton control should have a unique access key, which allows the user to select the button using the keyboard

Course ILT Default Radio buttons The selected button is called the default radio button and is either the radio button that represents the user’s most likely choice or the first radio button in the group You designate a radio button as the default radio button by setting the button’s Checked property to the Boolean value True

Course ILT Activity A-1 Adding a radio button

Course ILT Adding a Check box Checkbox controls are used to add a check box control to the interface Checkbox controls work like radio buttons in that they are only either selected or deselected continued

Course ILT Adding a Check box, continued You use Checkbox controls to permit the user to select any number of choices from a group of one or more independent and nonexclusive choices Any number of check boxes on a form can be selected at the same time

Course ILT Activity A-2 Adding a check box

Course ILT Activity A-3 Using the radio buttons and check boxes

Course ILT User-Defined procedures A user-defined Sub procedure is a collection of code that can be invoked from one or more places in an application Enter Private Sub SubName() just above the End Class statement The rules for naming a user-defined Sub procedure are the same as those for naming variables and constants The End Sub will automatically be generated

Course ILT Activity A-4 Creating a user-defined Sub procedure

Course ILT Generating Random numbers Visual Studio.NET provides a pseudo- random number generator, which is a device that produces a sequence of numbers that meet certain statistical requirements for randomness Dim GeneratorRandom As New Random() Methods –Next(minValue, maxValue) –NextDouble()

Course ILT Generating Random numbers, examples

Course ILT Activity A-5 Generating random numbers

Course ILT RadioButton Click event You can use the Visual Basic.NET Call statement, whose syntax is Call procedurename ([argumentlist]), to call (invoke) a user-defined Sub procedure The square brackets in the syntax indicate that the argumentlist is optional

Course ILT RadioButton Click event, examples

Course ILT Activity A-6 Coding the Grade1RadioButton and Grade2RadioButton Click events

Course ILT Addition and Subtraction events When the user clicks either the AdditionRadioButton control or the SubtractionRadioButton control, the control’s Click event procedure should display the appropriate mathematical operator and then generate and display two random numbers in the Num1Label and Num2Label controls

Course ILT Addition & Subtraction events, examples

Course ILT Activity A-7 Coding the AdditionRadioButton and SubtractionRadioButton events

Course ILT The Load event procedure Instructions entered in the form’s Load event procedure are processed when the application is started and the form is loaded into memory The following statement uses the RandomButton.PerformClick method, whose syntax is radiobutton.PerformClick(), to call the Addition radio button’s Click event, continued

Course ILT The Load event procedure,continued

Course ILT Activity A-8 Coding the Load event for a form

Course ILT Topic B Topic A: The Math Practice application Topic B: Completing the Math Practice application

Course ILT Activity B-1 Coding the CheckAnswerButton Click event

Course ILT SummaryCheckBox Click event The SummaryCheckBox control’s Click event procedure is responsible for both displaying and hiding the SummaryGroupBox control The procedure should display the group box control when the user selects the check box, and it should hide the group box control when the user deselects the check box

Course ILT SummaryCheckBox event, completed

Course ILT Activity B-2 Coding the SummaryCheckBox Click event

Course ILT Unit summary Learned how to Include radio buttons and check boxes in an interface, create and call a user-defined Sub procedure, use the Random object, and process code when a form is loaded into the computer’s memory Select the existing text in a text box control, code a check box control’s Click event procedure, and display and hide a control