CS 106 Computing Fundamentals II Chapter 35 “Controls For Choices”

Slides:



Advertisements
Similar presentations
What Was I Thinking??. Key Terms 1. Control 1. Control 2. Design Mode 2. Design Mode 3. Event 3. Event 4. Form 4. Form 5. Interface 5. Interface 6. Properties.
Advertisements

1 CS 106, Winter 2009 Class 8, Section 4 Slides by: Dr. Cynthia A. Brown, Instructor section 4: Dr. Herbert G. Mayer,
1 CS 106, Winter 2009 Class 4, Section 4 Slides by: Dr. Cynthia A. Brown, Instructor section 4: Dr. Herbert G. Mayer,
PSU CS 106 Computing Fundamentals II Visual Basic Program Creation HM 1/3/2009.
 Experiment with the Design features to get the look you want for your presentation.  Most design templates will keep the design the same on all your.
Adding Controls to User Forms. Adding Controls A user form isn’t much use without some controls We’re going to add controls and write code for them Note.
Shorter of two objects and changing color Functions, events and setting the color Susan Rodger, Duke University June 2008.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
1 CS 106 Computing Fundamentals II Chapter 16 “Naming In Excel” Herbert G. Mayer, PSU CS Status 7/6/2013 Initial content copied verbatim from CS 106 material.
1 CS 106 Computing Fundamentals II Chapter 17 “Introduction To VBA” Herbert G. Mayer, PSU CS status 6/30/2013 Initial content copied verbatim from CS 106.
1 CS 106 Computing Fundamentals II Chapter 25 “Variables, Assignment Statement” Herbert G. Mayer, PSU CS Status 7/4/2013 Initial content copied verbatim.
1 CS 106 Computing Fundamentals II Chapter 29 “Creating A User Form” Herbert G. Mayer, PSU CS Status 7/4/2013 Initial content copied verbatim from CS 106.
1 CS 106 Computing Fundamentals II Chapter 7 “Showing Developer Tab” Herbert G. Mayer, PSU CS status 6/17/2013 Initial content copied verbatim from CS.
Rubicon ATLAS A Basic User’s Manual.
1 CS 106 Computing Fundamentals II Chapter 34 “Conditionals In Excel” Herbert G. Mayer, PSU CS Status 7/17/2013 Initial content copied verbatim from CS.
Chapter 3 – Fundamentals of Programming in VB.NET VB.NET Controls VB.NET Events Numbers Strings Input and Output.
1 CS 106 Computing Fundamentals II Chapter 61 “Loops” Herbert G. Mayer, PSU CS Status 7/29/2013 Initial content copied verbatim from CS 106 material developed.
1 CS 106 Computing Fundamentals II Chapter 81 “Error Handling” Herbert G. Mayer, PSU CS status 6/14/2013 Initial content copied verbatim from CS 106 material.
1 CS 106 Computing Fundamentals II Chapter 32 “Boolean Expressions” Herbert G. Mayer, PSU CS Status 7/14/2013 Initial content copied verbatim from CS 106.
1 CS 106 Computing Fundamentals II Chapter 84 “Array Formulae” Herbert G. Mayer, PSU CS status 6/14/2013 Initial content copied verbatim from CS 106 material.
1 CS 106 Computing Fundamentals II Chapter 67 “Working With Files” Herbert G. Mayer, PSU CS status 6/24/2013 Initial content copied verbatim from CS 106.
1 CS 106 Computing Fundamentals II Chapter 21 “Computer Organization” Herbert G. Mayer, PSU CS Status 7/9/2013 Initial content copied verbatim from CS.
1 CS 106 Computing Fundamentals II Chapter 23 “Controls And Events” Herbert G. Mayer, PSU CS Status 7/5/2013 Initial content copied verbatim from CS 106.
2a – Object Oriented Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
1 CS 106 Computing Fundamentals II Chapter 211 “Coding And Debugging” Herbert G. Mayer, PSU CS status 6/29/2013 Initial content copied verbatim from CS.
Graphical User Interfaces Tonga Institute of Higher Education.
1 CS 106 Computing Fundamentals II Chapter 210 “Adding Controls to User Forms” Herbert G. Mayer, PSU CS Status 7/4/2013 Initial content copied verbatim.
Rubicon ATLAS A User’s Manual:. Rubicon ATLAS How to Log on and How to Edit: Essential Questions Enduring Understandings Knowledge Standards Unit Titles.
2c – Textboxes and Buttons Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
PART TWO Electronic Color & RGB values 1. Electronic Color Computer Monitors: Use light in 3 colors to create images on the screen Monitors use RED, GREEN,
1 CS 106 Computing Fundamentals II Chapter 6 “How To Zip & Unzip Files” Herbert G. Mayer, PSU CS status 6/17/2013 Initial content copied verbatim from.
Visual Basic A Quick Tutorial VB Review for ACS 367.
Using Option Buttons. Option Buttons Are similar to checkboxes. Must appear in groups. Only one button in the group can be selected at a time. Sometimes.
Controls for Choices. Let’s look at a couple of new controls: option buttons and check boxes These controls are designed to be used when you want the.
1 CS 106 Computing Fundamentals II Chapter 28 “Scope” Herbert G. Mayer, PSU CS Status 7/14/2013 Initial content copied verbatim from CS 106 material developed.
Knowledge Base. Defining a Variable Dim statement Dim intXX As Integer Public in a Module Public dblNN As Double.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
Using Text in Microsoft Paint Presented by: Divya Desai Robert Weiblen and James Pallikal 10 May 2005.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Visual Basic.NET BASICS Lesson 9 Nested If Statements and Radio Buttons.
1 CS 106 Computing Fundamentals II Chapter 42 “Sub Procedures And Functions” Herbert G. Mayer, PSU CS Status 8/5/2013 Initial content copied verbatim from.
1 CS 106 Computing Fundamentals II Chapter 85 “Excel Tables” Herbert G. Mayer, PSU CS status 6/14/2013 Initial content copied verbatim from CS 106 material.
Logical Operators.  Quizzes!  Let's look at the schedule  Logical Operators 2.
CS 106 Computing Fundamentals II Chapter 5 “Excel Basics for Windows”
Scratch for Interactivity
Chapter 4 The If…Then Statement
A First Look at GUI Applications Radio Buttons and Check Boxes
Chapter 8: Writing Graphical User Interfaces
3.01 Apply Controls Associated With Visual Studio Form
CS 106 Computing Fundamentals II Chapter 77 “Algorithm”
CS 106 Computing Fundamentals II Chapter 33 “Conditional Statements”
Introduction to Object-Oriented Programming
CS 106 Computing Fundamentals II Chapter 71 “Indexing”
CS 106 Computing Fundamentals II Chapter 73 “Ranges”
CS 106 Computing Fundamentals II Chapter 66 “Working With Strings”
Checking for Collisions: Using Functions in Alice
Herbert G. Mayer, PSU CS Status 8/2/2013
Conditional Logic Presentation Name Course Name
ECE 103 Engineering Programming Chapter 56 Runtime Errors
CS 106 Computing Fundamentals II Chapter 64 “For Loop Variations”
Chapter 15: GUI Applications & Event-Driven Programming
ECE 103 Engineering Programming Chapter 12 More C Statements
ECE 103 Engineering Programming Chapter 37 C Macro Parameters
ECE 103 Engineering Programming Chapter 8 Data Types and Constants
CS 106 Computing Fundamentals II Chapter 69 “Event Loop”
ECE 103 Engineering Programming Chapter 20 Change in Flow of Control
Group Boxes, Radio buttons and Checked List Boxes
Color Box Button - Gray Type : object Type : object Type : object
CHAPTER FOUR VARIABLES AND CONSTANTS
Presentation transcript:

CS 106 Computing Fundamentals II Chapter 35 “Controls For Choices” Herbert G. Mayer, PSU CS Status 7/17/2013 Initial content copied verbatim from CS 106 material developed by CS professors: Cynthia Brown & Robert Martin

Syllabus Controls For Choices Option Button Creating Option Buttons About the Demo Events

Controls for Choices Let’s look at new controls: option buttons and check boxes These controls are designed to be used when you want the user of the program to have choices We’ll use conditionals to determine which values have been set and have the program act accordingly

Option Buttons Option buttons come in groups, but only one button in the group can be selected We use the prefix opt for this control. Let’s say there are three buttons in a group for choosing a size, Small, Medium, or Large We can name our buttons optSmall, optMedium, and optLarge

Creating Option Buttons Generally start with a frame!! Then place Option Buttons into the frame; such as: Choose the Option Button tool in the Toolbox and create as many as you want in a group Name the buttons and change their text Notice that the buttons are round You are now ready to use them in a program

Check Boxes Check boxes are similar to option buttons but more than one in a group can be checked While option buttons make sense for choosing something like model or color, check boxes can be used for choosing something like features, where more than one can be chosen (AC, disk brakes, super sound package, leather seats, fancy wheels, etc.)

Creating Check Boxes It’s the same procedure as for option buttons, but the frame is optional Yet if you pick a frame, create it first The logic of the associated conditional will be different since more than one can be checked We’ll use the prefix chk for these named control

OptionDemo: If statements, check boxes, option buttons, demonstrated by showing HW3

About the Demo Check if an option -or check box- Value is True to see if it is selected: If chkTaller.Value Then btnPush.Height = btnPush.Height * 2 End If ‘ sometimes programmers code: If chkTaller.Value = True Then

Events Checking a box or selecting a button is an event. But if there is no code for an event, nothing happens There is no code for the event of selecting the red, blue, and green buttons. In HW3, their values are checked during the btnPush click event