Title: Introduction Overview of VB
1IntroductionOverview of VB
Chapter
ONE
2Characteristics of Business Applications
- Require some customization but do not rely
heavily on sophisticated mathematical analyses. - Business environment is frequently changing and
applications must reflect the realities of the
environment.
3What is Visual Basic?
- Visual Basic (VB) is a programming environment
that provides two things to the programmer - A set of programming tools which enable the
programmer to assemble and rearrange the
components (objects) of the program under
construction. - A programming language which enables the
programmer to compose the instructions that tell
the computer how to perform the tasks required by
the program under construction.
4What is Visual Basic?
- Programming Environment
- Controls (objects)
- Language
- Visual graphical user interface (GUI)
- Event-driven
- Rapid Application Development and prototyping
tool (RAD)
5Event-Driven Programming
- Visual Basic is used for creating event-driven
application programs. - Events are generated by the user, and the
application program responds to them. - Typically, a user enters data on a screen and
presses command buttons to initiate program
action.
6Conventional Programming Text-based Sequential
flow of control Control flow guided by the
application Program development is
non-interactive
Event-Driven Programming GUI-based No
predetermined flow of control Functions
triggered by user-generated
events Program development is interactive
7VB Uses the Windows Environment
- Mouse and mouse pointer
- Mouse operations -- pointing, clicking, double
clicking, dragging - Menus and commands
- Standard controls (Dialog boxes, Check boxes,
text boxes, command buttons, etc.) - Similar look and feel
- Multiple approaches to any operation
8Example Order Entry Screen
Used by a computer equipment retail outlet to
record data regarding customer orders.
9Characteristics of a good application
- Does what is needed
- Does it correctly
- Is easy to use
- Code is organized and maintainable
- Program is flexible
10A formal procedure for creating applications
- Identify user requirements
- Design the application GUI - User
Interface/Properties Functionality/Logic - Construct the application Build
GUI (forms/controls/properties) Write the
code Test
11IDE (Integrated Development Environment) VB 6
12Toolbar and toolbox
13The Properties window
14Completed Order Entry form
15(No Transcript)
16The Code window
17Structure of VB projects
.VBP
Project
0 or 1
1
.FRM
0
Custom Controls .VBX/.OCX
Resource file
0
Forms
.BAS
Class modules
1
0
Code modules
General declarations section
1
0
Controls
General sub procedures
General declarations section
0
1
General sub procedures
Event procedures
Properties
Methods
The structure of class modules has been omitted
for clarity.
18Structure of VB projects (simplified)
.VBP
Project
1
Forms
.FRM
0
Controls
1
0
Event procedures
Properties
19Project
- Visual Basic runs under the Windows operating
system. - The programmer uses VB to create the application.
The application under construction in VB is
called a project.
Break time
Programmer
20Project
- The programmer periodically saves the project to
disk.
Break time
Programmer
21Project
- The programmer periodically saves the project to
disk. - The completed project is made into an executable
file, which VB stores on disk. This file
contains the finished application program.
Break time
Programmer
22Project
- The programmer periodically saves the project to
disk. - The completed project is made into an executable
file, which VB stores on disk. This file
contains the finished application program. - The application is delivered to the user.
Break time
Programmer
Finished Application
User
23- The application runs under the Windows operating
system independently of VB. - The executable file cannot be modified if
changes to the application are required, the
programmer must use VB to open the project files,
modify the project, and then make a new
executable file.
Programmer
Finished Application
User