Download presentation
Presentation is loading. Please wait.
Published byLaurence Woods Modified over 9 years ago
1
Chapter Two Designing Applications Programming with Microsoft Visual Basic 2010 5 th Edition
2
Programming with Microsoft Visual Basic 2010, 5 th Edition Lesson B Objectives 2 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 control’s BorderStyle property Add a text box to a form Lock the controls on the form Assign access keys to controls Use the TabIndex property
3
Programming with Microsoft Visual Basic 2010, 5 th Edition Building the User Interface 3 Use TOE chart and sketch as guides when building user interface Place appropriate controls on forms Set applicable properties of controls Features of UI used in this lesson’s application Information arranged vertically Controls aligned and appropriately labeled Try to create an interface that no one notices
4
Programming with Microsoft Visual Basic 2010, 5 th Edition Building the User Interface (cont’d.) 4 Figure 2-12 Partially completed interface for the Playtime Cellular application
5
Programming with Microsoft Visual Basic 2010, 5 th Edition Building the User Interface (cont’d.) 5 Including graphics in the user interface Graphics: Icons or pictures added to an interface Used to emphasize or clarify a portion of screen, or for aesthetic purposes The human eye is attracted to pictures before text Include graphics sparingly Graphics for aesthetic use should be small and positioned to avoid distracting user
6
Programming with Microsoft Visual Basic 2010, 5 th Edition Building the User Interface (cont’d.) 6 Selecting fonts for the interface Font property controls font type, style, and size Recommendations for fonts Use sans serif fonts (without strokes) e.g., Segoe UI, Tahoma, Microsoft Sans Serif Use only one or two font sizes and one font type Avoid italics and underlining Limit bold text to titles, headings, and key items
7
Programming with Microsoft Visual Basic 2010, 5 th Edition Building the User Interface (cont’d.) 7 Adding color to the interface The eye is drawn to color before black and white Add color only if there is good reason Many people have trouble distinguishing color Guidelines for adding colors Use dark text against light background Avoid using dark color for background Limit colors to three, not including black, white, gray Colors added should be complementary Do not use color as only means of identification for an element in the UI
8
Programming with Microsoft Visual Basic 2010, 5 th Edition Building the User Interface (cont’d.) 8 BorderStyle property: Determines style of control’s border None: Ensures control will not have border FixedSingle: Surrounds control with thin line Fixed3D: Gives control a 3-D appearance (default) AutoSize property: Determines whether label control automatically sizes to fit its current contents Use True for identifying labels, but use False for output labels
9
Programming with Microsoft Visual Basic 2010, 5 th Edition Building the User Interface (cont’d.) 9 Adding a Text Box Control to the Form Text box control provides an area in the form for data entry Use TextBox tool to add a text box control Make all text boxes same size and align them using snap lines Blue snap lines used for vertical alignment Pink snap lines used for horizontal alignment
10
Programming with Microsoft Visual Basic 2010, 5 th Edition Adding a Text Box Control to the Form (continued) 10 Figure 2-13 Snap lines shown in the interface
11
Programming with Microsoft Visual Basic 2010, 5 th Edition Locking the Controls on a Form 11 Lock controls after they are properly placed Purpose: avoid inadvertently moving controls A locked control is identified by a small lock To lock controls Click form (or any control on the form) Click Lock Controls on the Format menu Follow same procedure to unlock controls
12
Programming with Microsoft Visual Basic 2010, 5 th Edition Assigning Access Keys 12 Access key Enables object to be selected using keyboard Key combination: Alt key + letter or number Each access key must be unique Shown in interface as underlined letter Assigning an access key Include an ampersand (&) in the control’s caption Example: “&Calculate Order” assigns ‘C’ to button
13
Programming with Microsoft Visual Basic 2010, 5 th Edition Assigning Access Keys (cont’d.) 13 Reasons to assign access keys Allow user to work even if mouse does not Allow fast typists to keep hands on the keyboard Allow people with disabilities that prevent them from using a mouse to be able to use application Follow Windows standards for assigning commonly used access keys
14
Programming with Microsoft Visual Basic 2010, 5 th Edition Controlling the Tab Order 14 Focus: State in which a control is ready to accept user input or action Pressing Tab key or access key shifts focus TabIndex property Number representing order in which control will receive focus when user presses Tab key Control with TabIndex of 0 receives focus first Set TabIndex using Properties window or Tab Order option on View menu Make a list of objects to determine proper ordering
15
Programming with Microsoft Visual Basic 2010, 5 th Edition Controlling the Tab Order (cont’d.) 15 Figure 2-15 TabIndex boxes showing the correct TabIndex values
16
Programming with Microsoft Visual Basic 2010, 5 th Edition Lesson B Summary 16 To specify control’s border Set BorderStyle property To lock/unlock controls on form Use Lock Controls option on Format menu To assign an access key to control Type an ampersand (&) in Text property of control or identifying label To set tab order Set TabIndex property to number that represents order in which you want the control to receive focus
17
Programming with Microsoft Visual Basic 2010, 5 th Edition True or False: The Me.Exit() method can be used to close the current form. 17
18
Programming with Microsoft Visual Basic 2010, 5 th Edition False 18
19
Programming with Microsoft Visual Basic 2010, 5 th Edition A(n) ____________________ control should be used to display text that the user cannot edit at run time. 19
20
Programming with Microsoft Visual Basic 2010, 5 th Edition Label 20
21
Programming with Microsoft Visual Basic 2010, 5 th Edition The rules of a programming language are called its ____________________. 21
22
Programming with Microsoft Visual Basic 2010, 5 th Edition Syntax 22
23
Programming with Microsoft Visual Basic 2010, 5 th Edition True or False: The Text property is only available for the label control 23
24
Programming with Microsoft Visual Basic 2010, 5 th Edition False 24
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.