Clearly Visual Basic: Programming with Visual Basic 2008

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

VISUAL BASIC Visual Basic is derived from the Basic language (Beginner’s All-Purpose Symbolic Instruction Code) Visual Basic uses an event-driven programming.
CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Chapter 1: An Introduction to Visual Basic 2012
Chapter 2: Designing Applications
Programming with Microsoft Visual Basic 2008 Fourth Edition
PROGRAMMING WITH MICROSOFT VISUAL BASIC TH EDITION Chapter Two Designing Applications.
1.
Excel and VBA Creating an Excel Application
Chapter 1: An Introduction to Visual Basic.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
Tutorial 21 Procedure-Oriented vs Object- Oriented/Event-Driven w Procedure-oriented Emphasis of a program is on how to accomplish a task User has little,
Microsoft Visual Basic 2010: Reloaded Fourth Edition
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter One An Introduction to Visual Basic 2010.
Slide 1 Chapter 2 Visual Basic Interface. Slide 2 Chapter 2 Windows GUI  A GUI is a graphical user interface.  The interface is what appears on the.
Chapter 8: String Manipulation
Programming with Microsoft Visual Basic th Edition
Clearly Visual Basic: Programming with Visual Basic 2008
Microsoft Visual Basic 2005: Reloaded Second Edition
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Chapter 4: The Selection Structure
1 Microsoft Visual Basic 2010 Week Two Designing Applications.
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
Teacher: Ms. Olifer MICROSOFT VISUAL STUDIO 2010: PROPERTIES OF WINDOWS FORM OBJECT.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Chapter 3: Using GUI Objects and the Visual Studio IDE.
Programming with Microsoft Visual Basic 2012 Chapter 2: Designing Applications.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 2 Creating a User Interface.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Chapter 2 - More Controls More controls – Text boxes - used for user input – Frames - containers to group items – check boxes - user select an option -
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Tutorial 11 Five windows included in the Visual Basic Startup Screen Main Form Toolbox Project Explorer (Project) Properties.
Chapter Two Designing Applications Programming with Microsoft Visual Basic th Edition.
Chapter Two Creating a First Project in Visual Basic.
Chapter Two Designing Applications Programming with Microsoft Visual Basic th Edition.
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.
1.
CSC115 Introduction to Computer Programming Zhen Jiang Dept. of Computer Science West Chester University West Chester, PA 19383
Chapter 15 I’m on the Inside; You’re on the Outside (Nested Loops) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Eight String Manipulation.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 4 Designing the Inventory Application Introducing TextBox es and Button s.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 16 I’m on the Inside; You’re on the Outside.
Chapter 2 More Controls Programming in C#. NET Objectives Use text boxes, group boxes, check boxes, radio buttons, and picture boxes effectively.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Chapter 2 Creating Applications with Visual Basic.
Visual Basic.NET Programming for the Rest of Us Keith Mulbery Utah Valley State College.
Chapter 10 So Many Paths … So Little Time (Multiple-Alternative Selection Structures) Clearly Visual Basic: Programming with Visual Basic nd Edition.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Programming with Microsoft Visual Basic 2012 Chapter 1: An Introduction to Visual Basic 2012.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter One An Introduction to Visual Basic 2008.
Chapter 4: Do-It-Yourself Designing (Designing Interfaces)
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
Chapter 1: An Introduction to Visual Basic .NET
Microsoft Visual Basic 2005: Reloaded Second Edition
Chapter 1: An Introduction to Visual Basic 2012
Chapter 1: An Introduction to Visual Basic 2015
Chapter 1: An Introduction to Visual Basic 2015
Chapter 2 Visual Basic Interface
CIS16 Application Programming with Visual Basic
CIS16 Application Development Programming with Visual Basic
Building an Application in the Visual Basic .NET Environment
Presentation transcript:

Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 5 Do It Yourself Designing

Objectives Use a text box to get user input Perform an action with a button control Code a control’s Click event procedure Stop an application using the Me.Close() instruction Clearly Visual Basic: Programming with Visual Basic 2008

Delegating the Work Figure 5-1 When designing interface for a problem Shows Addison Smith problem’s output, input, and algorithm When designing interface for a problem Examine each step in the problem’s algorithm, along with its output and input items Assign meaningful names to each of the controls listed in Figure 5-2 Camel case Uppercase letters appear as “humps” in the name Clearly Visual Basic: Programming with Visual Basic 2008

Clearly Visual Basic: Programming with Visual Basic 2008

Clearly Visual Basic: Programming with Visual Basic 2008

Clearly Visual Basic: Programming with Visual Basic 2008

It is customary to show the results of a calculation as a ____. Mini Quiz It is customary to show the results of a calculation as a ____. Using Hungarian Notation, which of the following is a good name for the city? cityTextBox TextBoxCity txtCity TxtCity The three-character ID for a button control name is ______. Page 78- Commission Calculator Program Create a new application program called Commission Calculator Project Change font property to Sego UI, 9pt and StartPosition to CenterScreen Change the forms Text Property to Commission Calculator Change the forms Name to: frmMain Clearly Visual Basic: Programming with Visual Basic 2008

Clearly Visual Basic: Programming with Visual Basic 2008

Delegating the Work (continued) Sentence capitalization Capitalize only first letter in each word and in any words that are customarily capitalized Example: identifying labels Book title capitalization Capitalize first letter in each word, except for articles, conjunctions, and prepositions Example: button captions Clearly Visual Basic: Programming with Visual Basic 2008

Making the Interface More User-Friendly Access key Allows user to select a menu using the Alt key in combination with a letter or number Not case sensitive Should be assigned to each control (in the interface) that can accept user input Allows user to work with interface even when mouse becomes inoperative Clearly Visual Basic: Programming with Visual Basic 2008

Clearly Visual Basic: Programming with Visual Basic 2008

Quick Access Keys- Driven by the ALT KEY Clearly Visual Basic: Programming with Visual Basic 2008

Clearly Visual Basic: Programming with Visual Basic 2008

Making the Interface More User-Friendly (continued) Tab order Determined by number stored in each control’s TabIndex property When interface is first created TabIndex values reflect the order in which each control was added to the form Clearly Visual Basic: Programming with Visual Basic 2008

Tab Order- View- Tab Order Clearly Visual Basic: Programming with Visual Basic 2008

Do What I Tell You To Do Code Event procedure Code Editor window Visual Basic instructions Event procedure Tells an object how to respond to an event Code Editor window Used to enter an event procedure’s code Clearly Visual Basic: Programming with Visual Basic 2008

The Me.Close() Instruction Tells the computer to close the current form Method A predefined procedure that you can call (or invoke) when needed Good programming practice: test a procedure after you have coded it Clearly Visual Basic: Programming with Visual Basic 2008

Mini Quiz 2 If a text box’s Tab Index is set to 7, it’s indentifying label should be set to: _______ If a text box’s access key is the letter t, you can move the focus to the text box by pressing _____ The first line in a procedure (when you double click on a button) is the: ______ procedure header Clearly Visual Basic: Programming with Visual Basic 2008

Review Questions To give the user control, assign the task to a: Button Label Picture Box Text Box Which of the following designates Z as an access key? *Zip Code ^Zip Code &Zip Code #Zip Code The computer processes a button’s click when the user: Clicks the button Uses button access code Tabs to the Button All of the These Which of the following appears in the header and associates the procedure with the btnSave control’s Click Event: The answer is: Handles.btnSave.Click Which of the following tells the computer to stop an application: The answer is Me.Close () Clearly Visual Basic: Programming with Visual Basic 2008

Page 93 #3 – Tip Calculator Interface Note: We are just doing Interfaces, Tab Orders, and Access Keys, NOT the programming- Except the Exit Button

Page 94 #4 Property Tax Solution Clearly Visual Basic: Programming with Visual Basic 2008

Property Tax Solution Algorithm Output: annual property tax Input: Assessed Value Property Tax Rate Algorithm: Enter assessed value and property tax rate Calculate annual property tax by dividing accessed value by 100, and then multiplying the quotient by the property tax rate Display the annual property tax

Page 95 #5 Sales Project Clearly Visual Basic: Programming with Visual Basic 2008

Sales Solution Algorithm Output: Total Sales, North Percent, South Percent, East Percent, West Percent Input: North region sales, South sales, East sales, West sales Algorithm: Enter North sales, South Sales, East Sales & West Sales Calculate Total Sales by added up all the regions sales Calculate North’s percent by dividing North’s Sales by Total Sales Calculate South’s percent by dividing South’s Sales by Total Sales Calculate East’s percent by dividing East’s Sales by Total Sales Calculate West’s percent by dividing West’s Sales by Total Sales Display Total Sales, North’s Percent, South’s percent, East’s Percent and West’s Percent

Summary A problem’s input, output, and algorithm Used when designing solution’s interface Text boxes provide area for user to enter data Buttons are used to perform action when clicked Output items typically appear in label controls Object names in Hungarian notation Begin with an ID that identifies the object’s type Clearly Visual Basic: Programming with Visual Basic 2008

Summary (continued) To prevent a label from changing its size while application is running: Change its AutoSize property to False A label’s BorderStyle property Determines whether the label has a border An interface’s tab order Determined by number stored in each control’s TabIndex Property The Me.Close() instruction Used to end an application Clearly Visual Basic: Programming with Visual Basic 2008