Return to IFS 110 class Notes Menu!

Project 1
Building an Application

What is Visual Basic?

Active Window
3 Windows in Visual Basic

  1. Form Window - user interface
  2. Project Window - codes for forms and modules
  3. Properties Window - properties of objects on the form (defaults)

Setting Development Environment Options

Types of Interfaces

Note: Interface chosen is a personal preference

Types of Interfaces

Problem in Lab : IDE may look completely different every time student comes to lab and starts Visual Basic

Arranging Toolbars
and Windows

Design and Run Time

Note: form becomes the window the application occupies on desktop

Forms Properties

Adding and Removing Controls

Note: 20 intrinsic controls are in the Toolbox of Visual Basic’s standard edition.
   
2000 Additional controls available from Microsoft and from third-party vendors
    255 controls max allowed on each form

3 Types of Controls
(Project One)

Removing Controls

  1. Point to Control
  2. Click left mouse button
  3. Press DELETE key

Setting Properties

Note: set at design-time by using the properties window
Note: only change values that differ from the default values

2 Sections of Properties Window

Property Examples

Note: can be changed during run-time

Property Examples

Naming Controls

Note: Name and Caption of control are two different properties.

Event Procedures

Note: events can be the execution of code statements at run-time

Event Procedures

 Functions and Methods

example: Val function takes whatever value given and converts it to a number, or zero if not possible
example: Setfocus method causes focus to be changed to a specific control on form (Text1.SetFocus)

Note: Visual Basic has many predefined functions and methods that you can use in your code

Writing Code

Note: Each block has a header and terminal statement to show where subroutine begins and ends

Note: These first and last statements are supplied by Visual Basic when you begin a new event subroutine.

Subroutine Format

Sub Command1_Click ( )

‘Display Commission Amount as val of UserInput * Rate

Text2.text = Val(Text1.text) * 0.15

Text1.SetFocus

End Sub

Note: Text in Blue supplied by Visual Basic

Coding Environment

Note: If statement can’t be converted error message displayed

Saving a Project

Documenting an Application

3 Parts of Print Dialog Box

  1. Form Image - prints blank form at design-time
  2. Code - prints code for module or entire project
  3. Form As Text - prints a list of all controls and property settings that are different from their default settings
Note: must first select current module (form) or the entire project before selecting parts to print

Project 1
Building an Application
END

Program Maturity Calculator Requirements

Return to IFS 110 class Notes Menu!