Sunteți pe pagina 1din 8

VISUAL BASIC

VISUAL BASIC is a high level programming language which


evolved from the earlier DOS version called BASIC.
BASIC means Beginners' All-purpose Symbolic Instruction Code. It is a
very easy programming language to learn. The code look a lot like
English Language. Different software companies produced different
versions of BASIC, such as Microsoft QBASIC, QUICKBASIC,
GWBASIC ,IBM BASICA and so on. However, people prefer to use
Microsoft Visual Basic today, as it is a well developed programming
language and supporting resources are available everywhere. Now, there
are many versions of VB exist in the market, the most popular one and
still widely used by many VB programmers is none other than Visual
Basic 6. We also have VB.net, VB2005, VB2008 and the latest VB2010.
Both Vb2008 and VB2010 are fully object oriented programming (OOP)
language.
VISUAL BASIC is a VISUAL and events driven Programming
Language. These are the main divergence from the old BASIC. In
BASIC, programming is done in a text-only environment and the
program is executed sequentially. In VB, programming is done in a
graphical environment. In the old BASIC, you have to write program
code for each graphical object you wish to display it on screen, including
its position and its color. However, In VB , you just need to drag and
drop any graphical object anywhere on the form, and you can change its
color any time using the properties windows.
On the other hand, because the user may click on a certain object
randomly, so each object has to be programmed independently to be able
to response to those actions (events). Therefore, a VB Program is made
up of many subprograms, each has its own program code, and each can
be executed independently and at the same time each can be linked
together in one way or another.

What programs can you create with Visual Basic 6?

With VB 6, you can create any program depending on your objective.


For example, if you are a college or university lecturer, you can create
educational programs to teach business, economics, engineering,
computer science, accountancy , financial management, information
system and more to make teaching more effective and interesting. If you
are in business, you can also create business programs such as inventory
management system , point-of-sale system, payroll system, financial
program as well as accounting program to help manage your business
and increase productivity. For those of you who like games and working
as games programmer, you can create those programs as well. Indeed,
there is no limit to what program you can create ! There are many such
programs in this tutorial, so you must spend more time on the tutorial in
order to learn how to create those programs.
WHY VISUAL BASIC 6.0 ?
Developers of todays world always want to create effective and
robust applications packed with impressive outlook in minimum time.
Windows programming using C and C++ was a pain to the programmer.
One had to write pages of code to display a very simple command button
on the screen. Visual Basic makes the life of a programmer much easier
by giving an Integrated Development Environment (IDE).
Using Visual Basic, One can create various types of programs.
One can create effective database programs with Visual Basic as the
front-end tool.
Graphics programming is another aspect of Visual Basic. One can
create effective very easily here. Not only that, users can create their
own controls that can be plugged in with other tools using ActiveX. One

can also write effective Internet programs using Visual Basic. All these
can do with minimum labor and time.
Visual Basic is a highly interactive programming language. It has
several features that allow the programmer to develop applications for
MS-Windows in an easy and efficient manner.
Visual Basic follows the standard syntax of basic, except that
some new language features have been added to it to give more
flexibility to the programmer. Visual Basic makes use of GUI for
creating robust and powerful applications.
The GUI which enable users to interact with an application. This feature
makes it easier to comprehence things in a quicker and easier way.
The integrated development environment:
One of the most significant changes in Visual Basic 6.0 is the
Integrated Development Environment (IDE). IDE is a term commonly
used in the programming world to describe the interface and
environment that we use to create our applications. It is called
integrated because we can access virtually the entire development tool
that we need from one screen called an interface. The IDE is also
commonly referred to as the design environment, or the program.
Integrated development is one in which we can develop, run, test and
debug your applications.
The visual basic IDE is made up of a number of components:

Menu Bar
Tool Bar
Project Explorer
Form Layout Window
Toolbox
Form Designer

Menu Bar - This menu bar displays the


commands that are required to build and
application. The main menu items have sub menu
items can be chosen when needed.
Tool Bar - The toolbar consists of picture buttons
that are shortcuts to some of the commonly used
Menu items. It gives the quick access to
commonly used menu commands. The tool bar is
clicked once to carry out the action represented by
it.
Project Explorer - The window titled project is
the project explorer, which displays the
Components of the project.
Form Layout Window - The form layout
window is used to determine the Initial positions
of the forms in your application. This window is
useful in applications that use multiple forms.
Tool Box- The toolbox contains a set of controls
that are used to place on a format design time
their by creating the user interface area.
Form Designer - The form designer is a main
window in the middle of the screen, and in it you
can design and edit the applications user interface.
The same window displays a text editor in which
you can enter and edit the applications code.
The form designer displays two windows for each form:
The form itself(the elements of the visible user
interface)
A Code window (the code behind the elements of the
form)
Properties Window - The properties window is
docked under the project explorer window. It

exposes the various characteristics of selected


objects.

Properties, Methods and Events:


Property -A property is a named attribute of programming object.
Properties define the characteristics of an object such as size, color etc or
sometimes the way in which it behaves. For e.g., a Text box accepts
properties such as Enabled, Font, Multi line, Text, Visible, Width etc.
Method - A method is an action that can be performed on objects.
In object oriented programming, a method is connected or built-in
procedure, a block of code that can be invoked to impart some action on
a particular object.
Event Drive Programming
Events determine the controls reactions to external
conditions. They are various things that can happen in a program. In an
event driven application, the program statements are executed only when
a particular event calls a specific part of the code that is assigned to the
event.
Module - A module is set of set statements.
Procedures - Procedures are building blocks of programs. A procedure
is a named sequence of statements executed as unit and it instructs the
application how to perform a certain task.

Control structures - Control structures are programming statements


that affect program execution, based on the outcome of some logical
comparison. There are two types of control structures they are:
1. Decision Structures- These structures enable the program to
make decisions on how it will operate based on test conditions. There
are If-Then, If-Then-Else, Select case.
2. Looping Structures- These structures enable the program to
execute a block of statement indefinite number of times based on a
condition. They are while-wend, do loop, for next.
Record set -A Record set object represents a base table or the records
that results from running a query. The record set objects are used to
manipulate the data in database at the record level.
Menu Editor - to create new menus and menu bars, add new commands
to existing menus, replace existing menu commands with your own
commands and change and delete existing menus and menu bars.
Popup Menus - a popup menu is floating menu is displayed over a form,
independent of the menu bar. The item displayed on the pop-up menu
depend on where the pointer was located when the right mouse button
was passed there fore, popup menus are also called context menus.
Multiple Document Interface (MDI):
The multiple-document interface allows you to create an
application that maintains multiple forms within single character form.
An MDI application allows the user to display multiple documents at the
same time, with each document displayed in its own window.
Using the Grid Controls:
The most common two-dimensional carry, a table is the best
presented to user in row and column format. The grid control offers a

convenient way for to display table data to the user. The users can
navigate the tables values using scroll bars. Therefore, the grid control
does not have to be large as the table, because the grid control displays
scroll bars.
Visual Basic includes two grid controls:
The Data Bound Grid (DBGrid)
The Flex Grid (MSFlex Grid)
The data Bound Grid is better at displaying data retrieved
directly from a Database.

The Flex grid is better at displaying data in unbound mode.


That is data supplied by the program. Flex Grid does offer some binding
capability, but bound data must be read only table form. This is often
the only practical way to display multiple set of data.
An MSFlex Grid control in Visual Basic is used to create
applications that present information in rows and columns. It displays
informations in cells. A cell is a location in the MSFlex Grid at which
the row and column intersect.
Almost every programmer uses a data grid for one project or
another. A grid enables users to view and edit data in a scrollable table
form. This is often the only practical way to display multiple set of data.
Many other controls can make programming tasks easier.
Some of the other frequently used controls that should include the
following:
Status Bar: it is used to display the partitioned status bar we
se at the bottom of the many popular applications.
Progress Bar: it is used to provide a graphical progress
indicator during long operations.
Chart: it is used to create pie, bar, line and many other types
of charts.

S-ar putea să vă placă și