microsoft visual basic 2005 reloaded second edition n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Microsoft Visual Basic 2005: Reloaded Second Edition PowerPoint Presentation
Download Presentation
Microsoft Visual Basic 2005: Reloaded Second Edition

Loading in 2 Seconds...

play fullscreen
1 / 53

Microsoft Visual Basic 2005: Reloaded Second Edition - PowerPoint PPT Presentation


  • 110 Views
  • Uploaded on

Microsoft Visual Basic 2005: Reloaded Second Edition. Chapter 2 Creating a User Interface. Objectives. After studying this chapter, you should be able to: Plan an application Complete a TOE chart Use a text box, table layout panel, and timer

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Microsoft Visual Basic 2005: Reloaded Second Edition' - sovann


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
objectives
Objectives

After studying this chapter, you should be able to:

  • Plan an application
  • Complete a TOE chart
  • Use a text box, table layout panel, and timer
  • Explain the difference between a primary window and a dialog box
  • Follow the Windows standards regarding the layout and labeling of controls

Microsoft Visual Basic 2005: Reloaded, Second Edition

objectives continued
Objectives (continued)
  • Follow the Windows standards regarding the use of graphics, fonts, and color
  • Assign access keys to controls
  • Set the tab order
  • Designate a default button and a cancel button
  • Explain the difference between a modal form and a modeless form
  • Add a splash screen and a dialog box to an application

Microsoft Visual Basic 2005: Reloaded, Second Edition

planning an application
Planning an Application

Microsoft Visual Basic 2005: Reloaded, Second Edition

planning an application continued
Planning an Application (continued)
  • Plan the application before creating the user interface
  • Work jointly with the user
  • TOE (Task, Object, Event) chart:
    • Shows application’s tasks, objects, and events
  • Tasks, objects, and events should be identified in the first 3 steps of planning

Microsoft Visual Basic 2005: Reloaded, Second Edition

skate away sales
Skate-Away Sales
  • Skate-Away Sales:
    • Sells skateboards at $100 each
    • Two colors: blue and yellow
    • Currently the salespeople calculate the order total
  • Develop an order-taking application for this company

Microsoft Visual Basic 2005: Reloaded, Second Edition

identifying the application s tasks
Identifying the Application’s Tasks

Microsoft Visual Basic 2005: Reloaded, Second Edition

identifying the application s tasks continued
Identifying the Application’s Tasks (continued)
  • First, review current user procedures and forms
  • Steps:
    • Identify the desired outputs
    • Identify the necessary inputs
    • Identify the processing needed to change the inputs into the outputs
    • Identify how the user will end the application
    • Identify the need to clear the screen between transactions

Microsoft Visual Basic 2005: Reloaded, Second Edition

identifying the application s tasks continued1
Identifying the Application’s Tasks (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

identifying the objects
Identifying the Objects
  • Assign each task to an object in the TOE
  • TextBox tool: instantiates a text box control
  • Text box:
    • Used to allow the user to input information
  • Use buttons to initiate the calculations
  • Use labels to guide the user

Microsoft Visual Basic 2005: Reloaded, Second Edition

identifying the objects continued
Identifying the Objects (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

identifying the objects continued1
Identifying the Objects (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

identifying the events
Identifying the Events
  • Text boxes: no special events needed for user to enter the text
  • Labels: no special events needed to display the prompts
  • Buttons:
    • Action must occur when each button is clicked

Microsoft Visual Basic 2005: Reloaded, Second Edition

identifying the events continued
Identifying the Events (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

identifying the events continued1
Identifying the Events (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

designing the user interface
Designing the User Interface
  • Follow Windows standards for:
    • Consistency
    • Ease of use
    • Familiar look and feel
  • Primary window:
    • The main window in an application
  • Dialog boxes: windows used to support and supplement a user’s activities in the primary window

Microsoft Visual Basic 2005: Reloaded, Second Edition

designing the user interface continued
Designing the User Interface (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

designing the user interface continued1
Designing the User Interface (continued)
  • Primary windows can be resized, minimized, maximized, and closed by the user
  • Primary window’s title bar includes:
    • Minimize, Maximize, and Close buttons on the right
    • Control menu on the left
  • Dialog boxes can be closed only
  • Dialog box’s title bar includes:
    • Close button and optionally a Help button
    • No control menu

Microsoft Visual Basic 2005: Reloaded, Second Edition

designing the user interface continued2
Designing the User Interface (continued)
  • Form object used to create primary window and dialog boxes
  • FormBorderStyleproperty:
    • Sets border style
    • Use default setting of Sizable for primary window
    • Use FixedDialog setting for dialog boxes
  • MinimizeBoxproperty and MaximizeBoxproperty control the existence of Minimize and Maximize buttons
  • Splash screen:
    • Set FormBorderStyle to FixedSingle
    • Set ControlBoxproperty to False to remove control menu

Microsoft Visual Basic 2005: Reloaded, Second Edition

designing the user interface continued3
Designing the User Interface (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

designing the user interface continued4
Designing the User Interface (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

designing the user interface continued5
Designing the User Interface (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

arranging the controls
Arranging the Controls
  • Guidelines:
    • Information should flow either vertically or horizontally
    • Group related controls together using white space or container controls
  • Container controls:
    • Group box control
    • Panel control
    • Table layout panel control

Microsoft Visual Basic 2005: Reloaded, Second Edition

arranging the controls continued
Arranging the Controls (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

arranging the controls continued1
Arranging the Controls (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

arranging the controls continued2
Arranging the Controls (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

arranging the controls continued3
Arranging the Controls (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

arranging the controls continued4
Arranging the Controls (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

arranging the controls continued5
Arranging the Controls (continued)
  • More guidelines:
    • Use a label with each text box
    • Left-align the label’s text
    • Position label to left of or above the text box it identifies
    • Labels and button captions should be 1 to 3 words only, and appear on one line
    • Labels and captions should be meaningful
    • Use sentence capitalization for labels

Microsoft Visual Basic 2005: Reloaded, Second Edition

arranging the controls continued6
Arranging the Controls (continued)
  • Sentence capitalization:
    • Only first letter in the first word is usually capitalized
  • Book title capitalization:
    • First letter in each word is capitalized (except articles, conjunctions and prepositions)

Microsoft Visual Basic 2005: Reloaded, Second Edition

arranging the controls continued7
Arranging the Controls (continued)
  • More guidelines:
    • Maintain a consistent margin from all edges of the form
    • Size buttons relative to each other
    • Minimize the number of different margins by aligning control borders where possible
    • Interface should not distract the user from doing the work

Microsoft Visual Basic 2005: Reloaded, Second Edition

slide32

Including Graphics in the User Interface

  • Human eye is drawn to pictures before text
  • Include graphics only if necessary
    • Use for aesthetic purposes
    • Use to clarify a portion of the screen

Microsoft Visual Basic 2005: Reloaded, Second Edition

including different fonts in the user interface
Including Different Fonts in the User Interface
  • Font property: used to change the type, style, and size of the font
  • Font:
    • General shape of characters in text
    • Size is measured in points
  • Point: 1/72 of an inch
  • Serif: a light cross stroke at top or bottom of a character
  • Sans serif fonts: do not have the cross strokes

Microsoft Visual Basic 2005: Reloaded, Second Edition

slide34

Including Different Fonts in the User Interface (continued)

  • Guidelines:
    • Use sans serif fonts on screens
    • Use only one font type for the text in a form
    • 12-point font is easiest to read at high screen resolution
    • Avoid italics and underlining
    • Use bold only for titles, headings, and key terms

Microsoft Visual Basic 2005: Reloaded, Second Edition

including color in the user interface
Including Color in the User Interface
  • Human eye is drawn to color before B&W
  • Guidelines:
    • Use color sparingly
    • Some people have trouble distinguishing colors
    • What is “acceptable” in colors is subjective
    • Color may have specific meaning in certain cultures
    • Use black or dark text on a white or light background
    • Use maximum of 3 different colors that complement each other
    • Do not use color as the only means of identification

Microsoft Visual Basic 2005: Reloaded, Second Edition

assigning access keys
Assigning Access Keys
  • Access key:
    • Allows user to select an object using Alt + access key
    • Appears underlined on the button caption
    • Is not case-sensitive
  • Guidelines:
    • Assign access keys to each control that can accept user input
    • Exceptions: OK and Cancel buttons

Microsoft Visual Basic 2005: Reloaded, Second Edition

assigning access keys continued
Assigning Access Keys (continued)
  • Advantages of using access keys:
    • User does not need mouse to navigate and activate controls
    • Allows fast typists to keep hands on keyboard
    • Facilitates use of the application by people with disabilities
  • Include & in front of the character to be used as the access key:
    • &Calculate Order  Calculate Order

Microsoft Visual Basic 2005: Reloaded, Second Edition

setting the tabindex property
Setting the TabIndex Property
  • TabIndex property:
    • Determines the order in which a control receives the focus when the Tab key is pressed
    • Starts at 0
  • Focus: the state of being able to accept user input
  • Default TabIndex values are set according to the order in which the controls were added to the form

Microsoft Visual Basic 2005: Reloaded, Second Edition

setting the tabindex property continued
Setting the TabIndex Property (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

setting the tabindex property continued1
Setting the TabIndex Property (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

designating default and cancel buttons
Designating Default and Cancel Buttons
  • Default button: activated when user presses Enter key
  • AcceptButtonproperty:
    • A form property
    • Designates the name of the default button
  • Cancel button: activated when user presses Esc key
  • CancelButtonproperty:
    • A form property
    • Designates the name of the cancel button

Microsoft Visual Basic 2005: Reloaded, Second Edition

including splash screens and dialog boxes in an application
Including Splash Screens and Dialog Boxes in an Application

Microsoft Visual Basic 2005: Reloaded, Second Edition

including splash screens and dialog boxes in an application continued
Including Splash Screens and Dialog Boxes in an Application (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

including splash screens and dialog boxes in an application continued1
Including Splash Screens and Dialog Boxes in an Application (continued)
  • Show method: displays a form as a modeless form
  • Modeless form:
    • Can remain displayed while user uses other forms
  • ShowDialog method: displays a form as a modal form
  • Modal form:
    • Requires user to take action in the form
    • Rest of the application is not usable until the modal form is closed

Microsoft Visual Basic 2005: Reloaded, Second Edition

including splash screens and dialog boxes in an application continued2
Including Splash Screens and Dialog Boxes in an Application (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the timer tool
The Timer Tool
  • Timer tool: instantiates a Timer control
  • Timer control: processes code at one or more regular intervals, specified by Interval property
  • Tick event: occurs after each interval has elapsed
  • Timer control does not appear on the form, but in the component tray
  • Component tray: area in the IDE that stores all controls that do not appear in the user interface at runtime

Microsoft Visual Basic 2005: Reloaded, Second Edition

the timer tool continued
The Timer Tool (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

the timer tool continued1
The Timer Tool (continued)

Microsoft Visual Basic 2005: Reloaded, Second Edition

programming tutorial
Programming Tutorial

Microsoft Visual Basic 2005: Reloaded, Second Edition

programming example
Programming Example

Microsoft Visual Basic 2005: Reloaded, Second Edition

summary
Summary
  • Plan the application jointly with the user
  • Identify tasks, objects, and events, and build a TOE chart
  • Textbox control: allows user to enter text
  • Primary window: where most of the user interfacing takes place
  • Dialog window: used to support the primary window
  • Follow Windows standards for GUI design

Microsoft Visual Basic 2005: Reloaded, Second Edition

summary continued
Summary (continued)
  • Align controls to flow horizontally or vertically
  • Group related controls visually with white space or container controls, and maintain consistent margins
  • Use meaningful labels and captions of 1-3 words
  • Use graphics and colors sparingly
  • Use sans serif font types for readability
  • Use TabIndex property to control where the focus goes when Tab key is used

Microsoft Visual Basic 2005: Reloaded, Second Edition

summary continued1
Summary (continued)
  • AcceptButton property designates which button on a form is activated with the Enter key
  • CancelButton property designates which button on a form is activated with the Esc key
  • Show method shows a form modeless
  • ShowDialog method shows a form modally
  • Timer control allows execution of code at specified intervals
  • A form’s Load event procedure executes code before the form is displayed

Microsoft Visual Basic 2005: Reloaded, Second Edition