You are on page 1of 5

Visual Basic Programming

1   _________________ Visual Basic Programming


3  _________________   
 ___________________     ___________________   
Visual Basic Overview Why Visual Basic?
 ___________________     ___________________   
 Visual Basic (VB) is a high level programming  ___________________     Power and complete Windows application  ___________________   
language evolved from the earlier DOS version development system
called BASIC.  ___________________     Supported by third party products
 ___________________   
 VB is a software development system developed
by Microsoft to support creating applications for  ___________________     Supports the principle of object driven design  ___________________   
the Windows operating systems.
 ___________________     Very flexible
 ___________________   
 VB introduced the concept of an event-driven User- friendly
 ___________________     ___________________   

programming model.
 Provides a Graphical User Interface or GUI.
 VB has incorporated the concept of objects.
 ___________________     The sequence of instructions executed in the  ___________________   
program is controlled by events
 ___________________     ___________________   
 ___________________     ___________________   
Introduction to Visual Basic * Property of STI
Page 1 of 19
 ___________________    Introduction to Visual Basic * Property of STI
Page 3 of 19
 ___________________   
 

Visual Basic Programming


2   _________________ Visual Basic Programming
4  _________________   
 ___________________     ___________________   
History of Visual Basic Graphical User Interface (GUI)
 ___________________     ___________________   
 BASIC stands for Beginner’s All-purpose  ___________________     Windows is a Graphical User Interface (or GUI)  ___________________   
Symbolic Instruction Code.
 ___________________     GUIs allow users to easily operate computers
using a pointing device (such as a mouse).
 ___________________   
 Developed by John Kemeny and Thomas Kurtz in
mid-1960s.
 ___________________     ___________________   
 ___________________     Prior to Windows 3.1 IBM PCs used a command
line interface (MS_DOS)  ___________________   
Visual Basic was developed in mid-1991 by the

Microsoft Corporation.  ___________________     All commands, input and screen output was
textual, one line at a time.
 ___________________   
 ___________________     Without knowing commands, users would be
 ___________________   
unable to proceed.
 ___________________     ___________________   
 ___________________     ___________________   
Introduction to Visual Basic * Property of STI
Page 2 of 19
 ___________________    Introduction to Visual Basic * Property of STI
Page 4 of 19
 ___________________   
 
Visual Basic Programming
5   _________________ Visual Basic Programming
7  _________________   
 ___________________     ___________________   
Event-Driven Programming VB Terminologies
 ___________________     ___________________   
 Procedural programs  ___________________    Event Procedure  ___________________   
 A block of code that is executed when an object is


Execution starts with the first line.
Program moves to different sections as required.
 ___________________    manipulated in a program. They typically evaluate
and set properties and use other program statements
 ___________________   
to perform the work of the program.
 The program calls the OS to get user input.
 ___________________    Program Statement
 ___________________   
 Event-driven programs
 ___________________     A keyword in the code that does the work of the
program. They create storage space for data, open
files, perform calculations, and do several other
 ___________________   
Instead of one program there are independent


sets of instruction.
Each (user-driven) event is associated with a
 ___________________    important tasks.
 ___________________   

separate set of instructions.
Code remains idle until called upon to respond to  ___________________    Method
 A special statement that performs an action or a
service for a particular object in a program.
 ___________________   
some event (button pressing, menu selection,…).
 ___________________    Class
 ___________________   
 ___________________     An implementation of an object type. It has a data
structure and methods that specify the operations
that may be used with that data structure.
 ___________________   
Introduction to Visual Basic * Property of STI
Page 5 of 19
 ___________________    Introduction to Visual Basic * Property of STI
Page 7 of 19
 ___________________   
 

Visual Basic Programming


6   _________________ Visual Basic Programming
8  _________________   
 ___________________     ___________________   
VB Terminologies VB Terminologies
 ___________________     ___________________   
Control  ___________________    Inheritance  ___________________   
 A tool used to create objects on a Visual Basic form.  Objects are organized into object classes, which are
It is used to create user interface elements, such as
command buttons, image boxes, and list boxes.
 ___________________    groups of objects sharing structural and behavioral
characteristics.
 ___________________   
Objects
 The name of a user interface element you create on a
 ___________________    Encapsulation
 The result (or act) of hiding the implementation
 ___________________   
Visual Basic form by using a toolbox control. They
have what is known as inherent functionality.  ___________________    details (information hiding) of an object from its
user.  ___________________   
Property
 A value or characteristic held by Visual Basic object,
 ___________________    Abstraction
 The benefit of being able to ignore the inner details
 ___________________   
such as Caption or ForeColor. Properties can be set
at design time by using the Properties window or at
run time by using statements in the program code.
 ___________________    of an object in order to focus on the aspects of the
object needed to use.  ___________________   
 ___________________    Polymorphism
 Creates objects that perform the same functions as
 ___________________   
 ___________________    the base object but performs some of these functions
in a different way.  ___________________   
Introduction to Visual Basic * Property of STI
Page 6 of 19
 ___________________    Introduction to Visual Basic * Property of STI
Page 8 of 19
 ___________________   
 
Visual Basic Programming
9   _________________ Visual Basic Programming
11  ________________   
Integrated Development
 ___________________    Integrated Development
 ___________________   
Environment (IDE)
 ___________________    Environment (IDE)
 ___________________   
 Like any other Windows application, VB consists  ___________________    Main Window  ___________________   
of multiple windows which appear at startup.  This is the only element of the IDE which is always

 The windows displayed in VB are collectively


known as the Visual Basic Integrated
 ___________________    visible.
 Selects which other IDE elements to view and to add
 ___________________   
forms or controls to your project.
Development Environment (IDE).
 ___________________     ___________________   
In particular, VB has the following windows:

 Main Window which contains Menu and Toolbar  ___________________     ___________________   
 Toolbox


Project Explorer Window
Property Window
 ___________________     ___________________   


Forms
Code Window  ___________________     ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
Introduction to Visual Basic * Property of STI
Page 9 of 19
 ___________________    Introduction to Visual Basic * Property of STI
Page 11 of 19
 ___________________   
 

Visual Basic Programming


10   ________________ Visual Basic Programming
12  ________________   
Integrated Development
 ___________________    Integrated Development
 ___________________   
Environment (IDE)
 ___________________    Environment (IDE)
 ___________________   
 ___________________    Toolbox Window  ___________________   
 This is simply a library of controls which can be

 ___________________    placed on the application.


 It is used to add art work, labels, buttons, list boxes,
 ___________________   
scroll bars, menus, and geometric shapes to a user
 ___________________    interface.
 Once all the controls needed are placed onto the
 ___________________   
 ___________________    applications forms, the toolbox can be hidden to
make room for working in the other elements of the
IDE.
 ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
Introduction to Visual Basic * Property of STI
Page 10 of 19
 ___________________    Introduction to Visual Basic * Property of STI
Page 12 of 19
 ___________________   
 
Visual Basic Programming
13   ________________ Visual Basic Programming
15  ________________   
Integrated Development
 ___________________    Integrated Development
 ___________________   
Environment (IDE)
 ___________________    Environment (IDE)
 ___________________   
Project Window  ___________________    Form Window  ___________________   
 This is simply a list of all forms and modules which  They are the windows which hold the various controls
make up your VB project.
 ___________________    (buttons, text boxes, etc.) which make up your
application.
 ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
Introduction to Visual Basic * Property of STI
Page 13 of 19
 ___________________    Introduction to Visual Basic * Property of STI
Page 15 of 19
 ___________________   
 

Visual Basic Programming


14   ________________ Visual Basic Programming
16  ________________   
Integrated Development
 ___________________    Integrated Development
 ___________________   
Environment (IDE)
 ___________________    Environment (IDE)
 ___________________   
Property Window  ___________________    Code Window  ___________________   
 Controls such as buttons, scrolling text boxes,  This is where you type in the code that VB executes.
pictures boxes and other features of most VB
applications allow you to enter parameters which
 ___________________    Notice that the heading of the window indicates with
which event the code is associated.
 ___________________   
define how these controls work.
 In VB, these parameters are called properties.

 Some properties can be entered at design time within


 ___________________     ___________________   
the IDE, while others must be entered with code
while the program is running.  ___________________     ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
Introduction to Visual Basic * Property of STI
Page 14 of 19
 ___________________    Introduction to Visual Basic * Property of STI
Page 16 of 19
 ___________________   
 
Visual Basic Programming
17   ________________ Visual Basic Programming
19  ________________   
 ___________________    Steps in Designing a VB
 ___________________   
Program Development Cycle
 ___________________    Application
 ___________________   
1. Analyze: Define the problem  ___________________    1. Decide on the Interface for the user. (Forms &
Controls)
 ___________________   
A common programming error is to begin coding
before analysis of the problem and design of the
solution is incomplete.
 ___________________     ___________________   
 What is the problem?

 Are there any special requirements of the


solution?
 ___________________    2. Determine which events the objects on the window
should recognize.  ___________________   
 ___________________    3. Write the events procedures for those events.
 ___________________   
2. Design: Plan the solution to the problem
The solution should consist of a logical sequence of
steps, called an algorithm.
 ___________________     ___________________   
 Time spent on design should result in a
significantly reduced implementation time.  ___________________     ___________________   
 ___________________     ___________________   
 ___________________     ___________________   
Introduction to Visual Basic * Property of STI
Page 17 of 19
 ___________________    Introduction to Visual Basic * Property of STI
Page 19 of 19
 ___________________   
 

Visual Basic Programming


18   ________________
 ___________________   
Program Development Cycle
 ___________________   
3. Choose the Interface: Select the objects  ___________________   
4. Code: Translate the algorithm into a programming
language
 ___________________   
5. Debug and Test: Locate and remove any errors in
the program
 ___________________   
6. Complete the Documentation: Organize all the
 ___________________   
materials that describe the program.
 ___________________   
 ___________________   
 ___________________   
 ___________________   
Introduction to Visual Basic * Property of STI
Page 18 of 19
 ___________________   
 
 

You might also like