Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 4: Do-It-Yourself Designing (Designing Interfaces)

Similar presentations


Presentation on theme: "Chapter 4: Do-It-Yourself Designing (Designing Interfaces)"— Presentation transcript:

1 Chapter 4: Do-It-Yourself Designing (Designing Interfaces)

2 Chapter Objectives After studying Chapter 4, you should be able to:
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 Microsoft Visual Basic 2012

3 Delegating the Work When designing an interface
Examine each step in the problem’s algorithm, along with its output and input items Assign meaningful names to each of the controls Beware of Hungarian notation and use camel case Make sure that each control has a purpose Clearly Visual Basic: Programming with Microsoft Visual Basic 2012

4 Delegating the Work (Cont.)
Figure 4-1 Problem specification, output, input, and algorithm for the Edwards and Son problem Clearly Visual Basic: Programming with Microsoft Visual Basic 2012

5 Delegating the Work (Cont.)
Figure 4-2 List of controls Figure 4-3 Name and purpose of each control Clearly Visual Basic: Programming with Microsoft Visual Basic 2012

6 Delegating the Work (Cont.)
Figure 4-4 Controls added to the form Clearly Visual Basic: Programming with Microsoft Visual Basic 2012

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

8 Delegating the Work (Cont.)
Making the Interface More User-Friendly Use an access key Users can use the keyboard Alt button The ampersand (&) key sets the letter after the to be the access key Alt key If you do not see the access keys press the alt key Figure 4-8 Access keys shown in the interface Clearly Visual Basic: Programming with Microsoft Visual Basic 2012

9 Delegating the Work (Cont.)
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 Also useful for people with disabilities that prevent them from using a mouse Clearly Visual Basic: Programming with Microsoft Visual Basic 2012

10 Delegating the Work (Cont.)
TabIndex property Sets the tab order allowing the user to use the keyboard’s tab key Figure 4-9 TabIndex values for the Label1 and txtRevenue control Figure 4-10 Correct TabIndex values for the interface Clearly Visual Basic: Programming with Microsoft Visual Basic 2012

11 Do What I Tell You to Do Tab order When interface is first created
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 Microsoft Visual Basic 2012

12 Summary Creating the user interface
Fourth step in the problem-solving process Windows applications in Visual Basic Composed of solutions, projects, and files Label controls Display text that user is not allowed to edit while an application is running Picture boxes Used to display images on a form Clearly Visual Basic: Programming with Microsoft Visual Basic 2012

13 Summary (Cont.) Good practice to save solution every 10-15 minutes
Form’s StartPosition property Specifies the position of the form when it first appears on the screen Font property Determines the type, style, and size of font used to display text on the form Picture box control’s Image property Specifies name of file containing the image to display Good practice to lock the controls in place on form Clearly Visual Basic: Programming with Microsoft Visual Basic 2012


Download ppt "Chapter 4: Do-It-Yourself Designing (Designing Interfaces)"

Similar presentations


Ads by Google