Sudhanshu Rai Visual Basic Assignment
Sudhanshu Rai Visual Basic Assignment
PATIALA
VISUAL BASIC
SUBMITTED TO:-
MRS. AMANDEEP KAUR
SUBMITTED BY:-
SUDHANSHU RAI
B.SC.(C.S.M.)
18481104
Visual Basic (VB)
Visual Basic (VB) is an event-driven programming
language and environment from Microsoft that provides
a graphical user interface (GUI) which allows
programmers to modify code by simply dragging and
dropping objects and defining their behavior and
appearance. VB is derived from the BASIC programming
language and is considered to be event-driven
and object-oriented.
VB is intended to be easy to learn and fast to write code
with; as a result, it is sometimes called a rapid application
development (RAD) system and is used
to prototype an application that will later be written in a
more difficult but efficient language.
The last version of VB, Visual Basic 6, was released in
1998, but has since been replaced by VB .NET, Visual
Basic for applications (VBA) and Visual Stuido .NET. VBA
and Visual Studio are the two frameworks most
commonly used today.
Visual Basic is an object-oriented programming
development system for creating applications that run
under any of the Microsoft Windows environments.
It has the following two major components:
1. An extensive collection of prewritten tools, called
controls. These controls are accessible as icons within a
graphical programming environment for creating
customized windows components (e.g., menus, dialog
boxes, text boxes, slide bars, etc.).
2. A complete set of program commands, derived from
Microsoft’s implementation of the classical Basic
programming language. The command set includes
features that embrace contemporary programming
practices.
The overall approach to Visual Basic programming is
twofold:
1. Create a user interface that is appropriate to the
particular application at hand.
2. Add a group of Basic instructions to carry out the
actions associated with each of the controls.
Visual Basic is a third-generation event-driven
programming language first released by Microsoft in
1991. It evolved from the earlier DOS version called
BASIC. BASIC means Beginners' All-purpose Symbolic
Instruction Code. Since then Microsoft has released
many versions of Visual Basic, from Visual Basic 1.0 to
the final version Visual Basic 6.0. Visual Basic is a user-
friendly programming language designed for beginners,
and it enables anyone to develop GUI window
applications easily.
In 2002, Microsoft released Visual Basic.NET(VB.NET) to
replace Visual Basic 6. Thereafter, Microsoft declared
VB6 a legacy programming language in 2008.
Fortunately, Microsoft still provides some form of
support for VB6. VB.NET is a fully object-oriented
programming language implemented in the .NET
Framework. It was created to cater for the development
of the web as well as mobile applications. However,
many developers still favor Visual Basic 6.0 over its
successor Visual Basic.NET.
Microsoft’s Visual Basic is an evolution of the BASIC
programming language that is designed to be used with a
richly featured programming interface called an
Integrated Development Environment (IDE). Prior to the
development of IDEs, programming with languages like
BASIC relied heavily upon the DOS command-line.
Programmers were required to write out their code
manually and use DOS to compile their programs into
executable files—a somewhat arduous process with
much room for error. An IDE, however, simplifies the
process dramatically by providing a unified interface that
facilitates coding and allows one-click compilation into an
executable file.
Coding with an IDE can be done manually or by dragging
and dropping popular commands and procedures. This is
a significant difference from languages like C++ where
the user is responsible for writing code from scratch. The
IDE can also check for potential errors in code and
suggest improvements and corrections. Because of its
simplicity, Visual Basic tends to be very approachable for
beginning programmers interested in writing simple
programs.
As a programming language designed by Microsoft,
Visual Basic is used primarily in a Windows environment
for writing system-specific applications. In , Microsoft
implemented Visual Basic within its .NET framework,
dubbing the new release Visual Basic.NET. For many
users, however, it is worth pointing out that Visual
Basic .NET is often still referred to as Visual Basic today
for simplicity.
Visual Basic features and characteristics
Visual Basic for Applications
VBA is not an entirely different language from Visual Basic.
Rather, as the name suggests, VBA is a specialized
implementation of the Visual Basic language that is designed to
be used within existing applications. Often bundled with
Microsoft applications like the Office Suite and third-party
programs like AutoCAD, VBA is designed to provide simple
programming options to extend the functionality of popular
programs.
The key word is “extend.” VBA cannot compile into a system
executable file on its own. Rather, it requires an interpreter to
read the “P-code” created through the compilation process. A
VBA program can be embedded in a Microsoft Word document,
for example, but cannot stand on its own as a program run
from the Windows Start Menu. For users wishing to write
programs from scratch, Visual Basic would normally be used
rather than VBA.
As with other intermediate language environments like Java,
VBA suffers a speed disadvantage when compared to the native
programs written in Visual Basic. The reason for this is that VBA
requires the additional step of interpretation by another
program. The extra steps and corresponding system resources
required to execute VBA programs mean that VBA is normally
not used if speed is an issue
EVENTS AND EVENT PROCEDURES
OBJECT-RELATED CONCEPTS
In addition to events and event procedures, you must
understand the meaning of each of the following terms:
Forms: In Visual Basic, a window is called a form. Each
form includes a title bar at the top. A form may also
include a menu bar, a status bar, one or more toolbars,
slide bars, etc. A user area (called a client area) occupies
the remaining space within the form. Some applications
are based upon a single form, while others require two
or more forms.
Controls: The icons with which the user interacts are
called controls. Commonly used controls include
command buttons, option buttons, check boxes, labels,
text boxes, picture boxes and menus. The user will
typically activate a control (e.g., click on a command
button) to produce an event.
The image below represent all some of the common
controls of visual basic.
Objects: Forms and controls are referred to collectively
as objects. Most objects are associated with events;
hence, objects may include their own unique event
procedures. Objects are also associated with their own
properties and methods. An object is a combination of
code and data that can be treated as a unit. An object
can be a piece of an application, like a control or a form.
An entire application can also be an object.
When you create an application in Visual Basic, you
constantly work with objects. You can use objects
provided by Visual Basic, such as controls, forms, and
data access objects. You can also use objects from other
applications within your Visual Basic application. You can
even create your own objects and define additional
properties and methods for them. Objects act like
prefabricated building blocks for programs — they let
you write a piece of code once and reuse it over and
over.
Each object in Visual Basic is defined by a class. A class
describes the variables, properties, procedures, and
events of an object. Objects are instances of classes; you
can create as many objects you need once you have
defined a class
Running a VB Project