Introduction to the Visual Basic Language and Environment
A. What’s New?
In this first class, we will do a quick overview of how to build an application
in Visual Basic. You’ll learn a new vocabulary, a new approach to programming,
and ways to move around in the Visual Basic environment. You will leave having
written your first Visual Basic program.
B. What Is It?
What is Visual Basic?
Visual Basic is a tool that allows you to develop Windows (Graphic
User Interface - GUI) applications. The applications have a familiar
appearance to the user.
Visual Basic is event-driven, meaning code remains idle until called
upon to respond to some event (button pressing, menu selection, ...).
Visual Basic is governed by an event processor. Nothing happens
until an event is detected. Once an event is detected, the code
corresponding to that event (event procedure) is executed. Program
control is then returned to the event processor.
Visual Basic implements graphical user interface that allows the use of
graphics for different applications. I t provides visual interactive windows with user,
like Dialogue box for (color, font ...), Input box, and Output box. Also it is able to
create menu to simplify user application.
To run this program on user computer: Start>programs>Microsoft Visual
Studio 6.0>Microsoft Visual Basic 6.0.
It will appear on the computer screen as in the following picture.
To exit from Visual Basic and return to Windows is like exit from most
Windows applications. There are three ways to close the Visual Basic as stated
below.
1- Click on close button icon that appears in the upper-left corner of the
screen.
2- Press Alt+F4
3- Select File >Exit
The Importance of Visual Basic Program
Languages like Basic and Pascal depend on variables and procedures to
build the applications .This is why it is called procedural languages. The new
approach is called object programming for visual programs like Visual Basic and
Visual C++ and others. In this programming approach every thing (form, command
buttons, controls) is an object.
The reasons for of implementing Visual Basic program are listed as follows:
1- It uses integrated development environment (IDE) which is easier for the
user to minimize code writing.
2- All visual programs follow the same concepts, therefore the user will become
more familiar with visual approach for other visual languages.
3- It provides Input box and Output box as an interactive windows with user.
4- It is able to connect to Internet, and to call Explorer.
Some Features of Visual Basic
Full set of objects - you 'draw' the application
Lots of icons and pictures for your use
Response to mouse and keyboard actions
Clipboard and printer access
Full array of mathematical, string handling, and graphics functions
Can handle fixed and dynamic variable and control arrays
Sequential and random access file support
Useful debugger and error-handling facilities
Powerful database access tools
ActiveX support
Package & Deployment Wizard makes distributing your applications simple
Visual Basic 6.0 versus Other Versions of Visual Basic
The original Visual Basic for DOS and Visual Basic For Windows were introduced
in 1991.
Visual Basic 3.0 (a vast improvement over previous versions) was released in
1993.
Visual Basic 4.0 released in late 1995 (added 32 bit application support).
Visual Basic 5.0 released in late 1996. New environment, supported creation
of ActiveX controls, deleted 16 bit application support.
And, now Visual Basic 6.0 - some identified new features of Visual Basic 6.0:
Faster compiler
New ActiveX data control object
Allows database integration with wide variety of applications
New data report designer
New Package & Deployment Wizard Þ Additional internet capabilities.
16 Bits versus 32 Bits
Applications built using the Visual Basic 3.0 and the 16 bit version of Visual
Basic 4.0 will run under Windows 3.1, Windows for Workgroups, Windows
NT, or Windows 95 ·
Applications built using the 32 bit version of Visual Basic 4.0, Visual Basic
5.0 and Visual Basic 6.0 will only run with Windows 95 or Windows NT
(Version 3.5.1 or higher).
In this class, we will use Visual Basic 6.0 under Windows 95, recognizing
such applications will not operate in 16 bit environments.
C. Learning Activities
ACTIVITY 1: WORD SEARCH: Look and encircle for the 10 key terms
used in the lesson.
ACTIVITY 2: Write True if the underlined word is correct and F it is wrong.
Write your answer in the space provided.
__________1. GUI means Graphic Userface Interface.
__________2. The original Visual Basic for DOS and Visual Basic For Windows were
introduced in 1981.
__________3. Visual Basic is event-driven, meaning code remains idle until called
upon to respond to some event (button pressing, menu selection.
__________4. One reason of implementing Visual Basic program is it provides Input
box and Output box as an interactive windows with user.
__________5. Visual Basic 4.0 released in late 1990 (added 32 bit application
support).
__________6. Languages like Basic and Pascal are called procedural languages.
__________7. To exit from Visual Basic and return to Windows is like exit from most
Windows applications.
__________8. Applications built using the 32 bit version of Visual Basic 4.0, Visual
Basic 5.0 and Visual Basic 6.0 will only run with Windows 95 or Windows NT
(Version 3.5.1 or higher).
__________9. Full set of objects - you 'draw' the application are some features of
Visual Basic.
__________10. Visual Basic provides visual interactive windows with user, like
Dialogue box for (color, font ...), Input box, and Output box. Also it is able to create
menu to simplify user application.