Nehru Arts And Science College
Visual Basic
Ms. V.Kavitha
Assistant Professor
Department of Computer Science
Nehru Arts and Science College
Coimbatore
UNIT - I
Module – I
Overview
What is Visual Basic?
Event and Event Procedure
Object Oriented Concepts
Visual Basic Development Process
Visual Basic Environment
What is Visual Basic?
Visual Basic is a tool that allows to develop Windows
(Graphic User Interface - GUI) applications .
Which runs under any of the Microsoft Windows
environment.
Create user interface (i.e) appropriate to the particular
application at hand.
Add the group of Basic instructions to carry out the
actions associated with each of the controls.
Event and Event Procedure
The program response to an action taken by the user is
referred to as an event
Eg: move the mouse, click the mouse button, enter text,
or move to a different window
The group of basic commands that brings about this
response is called an Event procedure
Eg: Private Sub btnClear_Click(...)
Handles btnClear.Click
-----
End Sub
Object – Oriented Concepts
Forms – A window is called a form, each form includes a
title bar, menu bar, a status bar, tool bars, slide bars , user
area which is a form. Eg: Fig:1 Shows the Design of Form
Controls - The icons with which the user interacts are
called controls
Eg: Command button, text boxes, option buttons
Objects - Forms and Controls are collectively referred to
as objects, it include own event procedures, own
properties and methods as shown in Fig:1
Sample Form
Figure: 1
Object – Oriented Concepts
Properties – Object include properties which define their
appearance or behavior
Eg: the name, caption, height, width, color are
associated with the command button
Methods – Object include ia a special program
statements called methods. A method is predefined
action affecting the associated object
Eg: Show is a method that can be used with a
hidden form to make it visible
The Visual Basic Program
Development Process
The general steps for developing a Visual Basic
application include Understanding the problem
Clearly define what the application is to do: purpose,
inputs, processing, outputs Design screens
Visualize application running and design its user
interface – sketch it on paper
Make a list of the controls needed, decide on their
names, and write a description
The Visual Basic Program
Development Process
Define the values of each control's relevant properties
Design actions behind buttons
Make a list of methods needed for each control (user
actions they must respond to)
Create a flowchart or write pseudocode for each
method
Check the code for errors by walking through its
execution (sketch screens and trace variables)
Build screens
The Visual Basic Program
Development Process
Start Visual Studio and create forms and other
controls Write code for actions
Write code for event procedures and other methods of
step 5 Test correctness
Attempt to run the application and correct syntax
errors Repeatedly run the program with test data as
input and correct any run-time or logical errors
The Visual Basic Environment
The Visual Basic Environment
The Visual Basic Environment
The Visual Basic Environment
The Visual Basic Environment
Title Bar
Menu Bar
Tool Bar
Form Design And Project Container Windows
ToolBox
Properties Window
Project Window
The Visual Basic Environment
Code Editor Window
Form Layout
Immediate Window
Repositioning
Resizing, Deleting, Adding And Docking Windows
Summary
VB is a tool to develop window based applications
Action taken by the user is Event and response of
command is called Event Procedure
Forms and Controls are collectively called as objects
Program development process which sketch out
overall layout of the project
VB environment which shows the opening of group
of windows in the desktop