Study guide: Visual Basic Interface Design

Course Outline

  1. GUI Design and Latte Selection
  2. Windows Desktop Projects and Workspace
  3. Configuring the Windows Form
  4. Adding and Formatting Labels
  5. Adding PictureBox Objects
  6. Sizing and Aligning Form Objects
  7. Saving and Opening Visual Studio Projects
  8. Program Development Life Cycle
  9. Gathering and Analyzing Requirements
  10. User Interface Design Principles
  11. Latte Selection Interface Mock-Up

1. GUI Design and Latte Selection

★ Must-know

  • An event-driven program with a graphical user interface should have its user interface designed after the program's purpose is defined.

  • The latte-selection application opens with a Latte Selection window, displays a pumpkin spice or mocha latte picture when the corresponding button is clicked, and informs the user that a flavored latte was selected when Select Latte is clicked.

Further detail

  • Visual Studio and Visual Basic rapid application development tools are used to design the user interface before implementation.

Memory Hook

Choose a flavor, view its picture, then select the latte.

2. Windows Desktop Projects and Workspace

Key Concepts & Definitions

  • Project: Equivalent to a single program created using Visual Studio.
  • Windows Form object: The window used to build a program and then display it when the program runs.
  • Windows Classic Desktop project: A program with a user interface whose windows are created using the Windows operating system.

★ Must-know

  • To create a Visual Basic Windows Desktop project, choose New Project, select Windows Desktop and Windows Forms Application if needed, enter the project name, and choose OK.

Further detail

  • When a program runs, the user interacts with it through its windows and components, which make up its user interface.

  • The Visual Studio work area contains a tabbed Form1.vb [Design] page with a Windows Form object called Form1.

  • 🔄 Display and pin the Toolbox:

    1. Choose the Toolbox button in the left margin.
    2. Choose Common Controls if needed.
    3. Choose the pushpin Auto Hide button on the Toolbox title bar to keep the Toolbox displayed.
  • The Properties window describes object characteristics such as color, size, name, and screen position, and its property names appear in Alphabetical view, which many developers find easiest for searching.

3. Configuring the Windows Form

Key Concepts & Definitions

  • Text property: The value displayed in the window's title bar.

Essential Points

  • 🔄 Rename the form file:

    1. Display Solution Explorer from the View menu if needed.
    2. Open the shortcut menu for Form1.vb.
    3. Choose Rename.
    4. Enter frmLatteSelection.vb and press Enter.
  • 🔄 Set the form title:

    1. Select the Windows Form object.
    2. Find the Text property in the Properties window.
    3. Enter Latte Selection and press Enter.
  • The form's Size property is set to 730, 700 by entering those values in the Properties window.

4. Adding and Formatting Labels

Essential Points

  • 🔄 Add the label:

    1. Drag the Label .NET component from Common Controls in the Toolbox.
    2. Place it at the desired location on the form.
    3. Release the mouse button.
  • 🔄 Name the label:

    1. Select the Label object.
    2. Find its (Name) property in the Properties window.
    3. Enter the new name in the value column and press Enter.
  • 🔄 Change the label text:

    1. Select the Label object.
    2. Find its Text property in the Properties window.
    3. Enter the new text and press Enter.
  • 🔄 Set the label font:

    1. Select the Label object and find its Font property.
    2. Choose the ellipsis button for the Font property.
    3. Choose a font, font style, and size in the Font dialog box.
    4. Choose OK.
  • 🔄 Center the label horizontally:

    1. Select the Label object.
    2. Choose Format and point to Center in Form.
    3. Choose Horizontally.

5. Adding PictureBox Objects

Key Concepts & Definitions

  • PictureBox: An object much like a label.

Essential Points

  • 🔄 Name the PictureBox:

    1. Select the PictureBox object.
    2. Locate its (Name) property in the Properties window.
    3. Enter the name in the value column and press Enter.
  • To resize a PictureBox object, enter the desired size beside its Size property and press Enter.

  • 🔄 Add another PictureBox:

    1. Drag another PictureBox .NET component from the Toolbox.
    2. Place it anywhere on the form.
    3. Release the mouse button.

6. Sizing and Aligning Form Objects

Essential Points

  • To make objects the same size, select the reference object, hold Ctrl while selecting the object to resize, then choose Format > Make Same Size > Both.

  • To align the PictureBox objects by their lower edges, select both PictureBoxes and choose Format > Align > Bottoms.

  • To center both PictureBox objects horizontally in the form, select them and choose Format > Center in Form > Horizontally.

  • A second Button can be added by dragging the Button control from the Toolbox onto the form and releasing it when the red alignment guide indicates that its top aligns with the existing button.

  • To align buttons vertically, drag one button until blue snap lines appear, adjust its vertical spacing, and release the mouse button.

7. Saving and Opening Visual Studio Projects

Essential Points

  • Save a Visual Studio project by clicking Save All on the Standard toolbar; the first save stores the project in the chosen location with its chosen name.

  • A Visual Studio project can be opened by double-clicking its solution file, using Open File on the Standard toolbar, or selecting it under File > Recent Projects and Solutions.

8. Program Development Life Cycle

Key Concepts & Definitions

  • Program Development Life Cycle: The set of phases and steps developers follow to design, create, and maintain a computer program.

Essential Points

  • The Program Development Life Cycle consists of gathering and analyzing requirements, designing the user interface, designing program processing objects, coding, testing, documenting the program or system, and maintaining the program or system.

Memory Hook

Requirements lead to design, then code, test, document, and maintain.

9. Gathering and Analyzing Requirements

Key Concepts & Definitions

  • Use Case: A sequence of actions a user performs when using a program.

★ Must-know

  • Requirements gathering includes:
    • Interviewing users.
    • Reviewing current procedures.
    • Completing other fact-gathering tasks.

📌 The Latte Selection program must show pumpkin spice and mocha choices until a type is selected, display the selected latte picture instead of the other picture, and show only one picture at a time.

📌 After a latte selection, the program must show a confirmation, prevent further flavor identification, allow only exiting the window, and permit selection only after a latte type has been chosen.

Further detail

  • The two types of requirements documentation are a requirements document and a Use Case Definition.

  • The Latte Selection requirements document was submitted January 23, 2019, and states that the program lets users choose a latte type from two displayed choices.

  • The Latte Selection use case has the user choose Pumpkin Spice or Mocha, view latte pictures by clicking flavor buttons, click Select Latte, receive a confirmation as flavor and selection buttons are disabled and Exit Window becomes active, then exit using that button.

10. User Interface Design Principles

Key Concepts & Definitions

  • Presentation layer: The part of program design in which Visual Studio is used to create the user interface.

★ Must-know

📌 A user interface should be easy to use and follow because users will not be satisfied if it is difficult to use.

📌 A well-designed interface feels natural, uses the most appropriate object for each requirement, and uses the same object for the same requirement throughout the program.

Further detail

  • Developers sometimes spend 25 to 40 percent of program design on the user interface.

  • Interface designs are often called mock-ups.

  • The primary interaction methods are:

    • Keyboard.
    • Pointing device such as a mouse.
    • Touch interface.
    • Voice input.

📌 Interface objects should be arranged in the sequence in which they are used, and the interface should be as simple as possible while retaining all required functionality and remaining intuitive.

11. Latte Selection Interface Mock-Up

★ Must-know

  • The interface requires:
    • One Windows Form object to contain the other objects.
    • Two PictureBox objects for pumpkin spice and mocha latte pictures.
    • Four Button objects.
    • Three Label objects.

Further detail

  • For Latte Selection, a Windows Forms App with a Windows Form is appropriate because the application is presented in a window on the screen.

  • The Latte Selection interface must provide a Select Latte button that displays a confirmation message and an Exit Window button as the only available action after selection.

  • The Latte Selection interface should include simple instructions so users are not confused while using it.

Test yourself

Take a 24-question practice quiz on Visual Basic Interface Design, with every answer explained.

1. A developer has defined the purpose of an event-driven program with a graphical user interface. What should the developer do next in the design process?

2. In a latte-selection application, a user clicks Mocha and then clicks Select Latte. What should the application display and communicate?

Take the quiz →

Study with flashcards

Memorize the key concepts of Visual Basic Interface Design with 63 flashcards.

When should an event-driven program's user interface be designed?

After the program's purpose is defined.

What window opens when the latte-selection application starts?

The Latte Selection window.

What happens when the pumpkin spice or mocha button is clicked?

The corresponding latte picture is displayed.

See the flashcards →

Related classes

Make your own study guides

Upload your class notes and Revizly writes a study guide, a quiz and flashcards in about a minute.

Study guide maker