Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Lesson A Objectives
After studying Lesson A, you should be able to:
Plan an object-oriented Windows application in
Visual Basic 2015
Complete a TOE (Task, Object, Event) chart
Follow the Windows standards regarding the
layout and labeling of controls
Planning an Object-Oriented
Application
Actively involve the user in the planning
phase
The end product should closely match the
users needs and wants
TOE chart
Used to record tasks, objects, and events
required for the application
Planning an Object-Oriented
Application
(cont.)
Planning an Object-Oriented
Application
(cont.)
Planning an Object-Oriented
Application
(cont.)
Button control
Performs an action immediately after a Click
event
Text box
Provides an area for the user to enter data
Planning an Object-Oriented
Application
(cont.)
10
Planning an Object-Oriented
Application
(cont.)
11
Planning an Object-Oriented
Application
(cont.)
12
Planning an Object-Oriented
Application
(cont.)
Horizontal arrangement:
Information flows from left to right, with
essential information placed in the first row
Programming with Microsoft Visual Basic 2015
13
Planning an Object-Oriented
Application
(cont.)
14
Planning an Object-Oriented
Application
(cont.)
15
Planning an Object-Oriented
Application
(cont.)
Sentence capitalization
Only the first letter in the first word is
capitalized
Use for identifying labels
16
Planning an Object-Oriented
Application
(cont.)
17
Lesson A Summary
Steps to create an OO application:
Meet with the client
Plan the application
Identify needed tasks, objects, and events
Identify information needed as input to produce
the desired result
18
Lesson B Objectives
After studying Lesson B, you should be able to:
Build the user interface using your TOE chart
and sketch
Follow the Windows standards regarding the use
of graphics, fonts, and color
Set a controls BorderStyle, AutoSize, and
TextAlign properties
Add a text box to a form
Lock the controls on the form
Assign access keys to controls
Set the TabIndex property
Programming with Microsoft Visual Basic 2015
19
20
(cont.)
21
(cont.)
22
(cont.)
23
(cont.)
24
(cont.)
25
(cont.)
26
27
28
(cont.)
29
TabIndex property
A number representing the order in which a
control will receive the focus when the user
presses the Tab key
A control with a TabIndex of 0 receives the
focus first
(cont.)
31
Lesson B Summary
Use appropriate graphics, fonts, and colors in
an interface
Set the BorderStyle, AutoSize, and TextAlign
properties
To lock/unlock controls on a form, use the
Lock Controls option on the FORMAT menu
To assign an access key to a control, type an
ampersand (&) in the Text property of the
control or identifying label
To set the tab order, set the TabIndex
property to a number that represents the
order in which you want the control
to
Programming with Microsoft Visual Basic 2015
32
receive the focus
2016 Cengage Learning. May not be scanned, copied or duplicated, or
posted to a publicly accessible website, in whole or in part.
Lesson C Objectives
After studying Lesson C, you should be able to:
Code an application using its TOE chart
Plan an objects code using either pseudocode or
a flowchart
Write an assignment statement
Send the focus to a control during run time
Include internal documentation in the code
Print an interface from code
Show and hide a control during run time
Write arithmetic expressions
Use the Val and Format functions
Locate and correct syntax errors
Programming with Microsoft Visual Basic 2015
33
34
(cont.)
Figure 2-22 TOE chart (ordered by object) for the bakery application
35
(cont.)
36
(cont.)
37
(cont.)
38
(cont.)
39
String
Zero or more characters enclosed in quotation
marks ("")
41
42
44
45
46
Order of operations:
PEMDAS (Parentheses, Exponents, Multiplication,
Division, Addition, Subtraction)
Modulus operator
Returns the remainder of the division
Programming with Microsoft Visual Basic 2015
47
(cont.)
Figure 2-34 Expressions containing more than one operator having the same precedence
48
49
51
52
53
Figure 2-41 Format functions syntax and some of the predefined format styles
54
55
Valid data
Data that the application is expecting
Invalid data
Data that the application is not expecting
Debugging
The process of locating and correcting errors in
a program
Errors can be related to either syntax or logic
Programming with Microsoft Visual Basic 2015
56
Syntax error
Occurs when a rule of a programming language
is broken
Typos
Logic error
Occurs when the syntax is correct, but the
outcome is not what was desired
Causes may include missing instructions,
instructions out of order, or the wrong type of
instruction
Figure 2-44 Result of hovering the mouse pointer over the statement containing the syntax error
58
59
60
(cont.)
61
Lesson C Summary
Use pseudocode or a flowchart to plan an
objects code
To assign a value to the property of an object
while an application is running, use an
assignment statement with the syntax
object.property = expression
To create comments, begin the comment
text with an apostrophe ()
Use the integer division operator (\) to divide
and return an integer result
Programming with Microsoft Visual Basic 2015
62
Lesson C Summary
(cont.)
63