VB UNIT - I
VB UNIT - I
INTRODUCTION TO VB
1. Write a short note on VB IDE
Visual basic is not a simple programming language. It is an integrated development
environment (IDE) in which you can design, run, test, debug, and deploy different applications such
as standard Exe application ,DHTML application , IIS application , Web applications, XML web
Services and traditional client applications etc.....
Visual Basic IDE is a user friendly environment, it always starts with a project window rather than
a simple file window as it is normal in other cases. When you start Visual Basic, you get a project
window with a new project dialog.
1) The Title Bar: contains to title, working mode and control button.
• The project title (default title: Project 1)
• working mode:
Design - during designing the user interface and writing code.
Run - during running / testing the project.
Break - during his time errors or pause or break - points.
• Control Buttons:
Minimize - To minimize the screen
Maximize - To maximize the screen.
Close - To terminate the program execution.
The menu bar contains the commands you need to work with Visual Basic. There are thirteen basic
menus are available to you, each focusing on a specific purpose.
Few of them are mentioned below: File, Edit, View, Project, Format, Debug, Run, Query,
Diagram, Tools, Add-Ins, Window and Help.
3) The Toolbars:
The Toolbar icon give quick access to commonly used menu commands. The toolbars is
displayed by default just below the menu bar.
The Form Layout window which is at the lower-right corner of the Visual Basic IDE. It can
be used to specify the initial position of the form that should appear on the screen at run time.
When mouse pointer you can move the form around and place at desired position as if it is
move on the screen in which the form is displayed at run time.
The immediate window at the bottom of the Visual Basic IDE. It is a debugging tool. While
an application is running we can stop and use the immediate window to examine or changes the
values of the applications variables and to execute visual basic commands in immediate mode.
Earlier versions of VB (1.0 and 2.0) were considered as" Hobbyist's language" had limited
features and dismal performance compared to applications written in other languages Like C.
VB 3.0 become much more database friendly and MS Jet engine was introduces along with
MS access databases.
Visual basic 4.0 supported 32-bit programs; OCX or ActiveX and DLL were introduced
along with more powerful Jet engine.
Visual basic 5.0 was the first version of VB, which provided a native code compiler i.e.
generates machine code. It also supports ActiveX Documents, ActiveX DLL’s.
Visual basic 6.0 is the recent addition to the family of Microsoft Visual basic 6.0 is
specifically designed to utilize the internet. User can easily create web based applications called
ActiveX executables which are similar to Internet explorer 4.0 or higher web browsers.
VB 6.0 supports ADO (ActiveX Data objects ) DHTML and IIS (Internet Information
Services),ISAPI'S (Internet Service API).
The new formatting string, numeric functions and new validate events for input controls
increase the Learning rate of a novice programmer.
Today VB 6.0 has become technology leader, implementing new ways of doing things
before any other visual programming development tools.
3) Object Oriented:
Object Oriented Programming is a Concept where the programmer thinks of the program
in "objects” that interact with each other". Visual Basic forces this good programming
practice
4) Debugging :
Visual Basic offers two different options for code debugging .Debugging Managed code
Runtime Debugger. The Debugging Managed Code individually debugs c and C++
applications and Visual Basic windows applications. The Runtime Debugger helps to find
and fix bugs in programs at runtime.
By using data access feature, we can Create databases, scalable server-side Components
for most databases, including Microsoft SQL Server and other enterprise level database
6) Macros IDE:
The Macros integrated development environment is Similar in design and function to the Visual
Studio IDE. The Macros IDE includes a code editor, tool window, the properties window and
editors.
7) ActiveX:
This technology allow to use the functionality provided by other applications such as Microsoft
word processor, Microsoft Excel spreadsheet, and other windows application.
8) Internet Access:
Internet Access capabilities make it easy to provide access to documents and applications
across the Internet or Intranet from within your applications or to create Internet server applications.
The menu bar contains the commands we need to work with VB. There are thirteen basic
menu are available.
Few of them are mentioned below: File, Edit, View, Project, Format, Debug, Run, Query,
Diagram, Tools, Add-Ins, Window and Help.
File: File contains the commands which could operate on project rather on single tile. The
commands such as new, save and save as etc... to use with projects.
A command for making executable file of the selected project which could be easily
run as normal Exe file.
Edit: It contains editing commands like copy, paste and undo plus a number of
commands for formatting and editing your code like find and Replace.
Project: It contains commands that add components to the current project, references
windows objects and new tools on the toolbox.
Format: It contains commands for aligning and sizing controls on the form.
Run: It contains commands that start, break and end execution of the current applications.
Tools: It contains tool you need in building ActiveX components and ActiveX controls.
It contains the commands to start the Menu Editor to Build your own Menus in your
Application and Option Commands
Add-Ins : It contains Add-Ins that you add remove needed. By default only the visual
data manager Add-Ins is installed that lets you create small data base application with the
visual basic data manager.
The other Menu like Window and Help are similar to any other Microsoft Applications.
The Tool box contains the icons of the controls you can place on a form to create
the application's User Interface.
By default, the Toolbox contains the pointer icon and the icons of 20 ActiveX controls
Pointer
The pointer is not a control but can be used with the controls on the form i.e. resize, move
them etc.
PictureBox
This control is used to display images. The images are set with the picture property of
this control.
Label
This control is used to display text that the user cannot edit it. The text is set with the
caption property of this control. Normally this control is used to display names, initial values at
design time and program results at run time through the code.
TextBox
This control displays text that the user can edit. The text is set with the text property
of this control. This control normally used to accept the inputs from the user and also to display
program results to the user.
Frame
This control is used to group the other controls. It used to draw boxes on the form
and other required controls can be placed inside this box area making a group of controls on the
form.
CommandButton
A command button represents an action that is carried out when the user clicks the
button. Action is associated with the click event of this control in program code.
CheckBox
This control is used to provide a choice of selection to the user. It shows a check
(or right) mark on one click and clears on another click i.e. it toggles (or changes) on every click.
The value property of this control is used to check and uncheck it.
OptionButtons
This control also called as radio button is used to provide a choice of action to the
user. It shows a small shaded dot like circle when selected and cleared when not selected i.e.
toggles on every click. The value property is used to on and off like car radio button.
ComboBox
This control is similar to ListBox control but it contains text edit field. The user
can select an item from the list like ListBox control or enter new text in the edit field.
Timer
This control facilitates the user to schedule certain events in the program. It has the
facility to set time intervals. The interval property of this control is set to schedule the events.
Shape
This control is used to draw graphical elements, such as rectangles, circles, and squares
on the form.
Line
Similar to the shape control, the line control can be used to draw the straight lines on the
form.
DrivelistBox
This control displays the drives on the system in a drop-down list form. The user can
select any drive from the list.
DirectoryListBox
This control displays a list of all folders in the current drive and lets the user move up or
down in the hierarchy of the folders.
FileListBox
This control displays a list of all files in the current folder or directory.
Data
This control is used to connect databases. This has many properties and methods to
facilitate data access.
OLE
This control can be used to interact with the other windows applications such as MS
word or Excel etc. Through this control you can access the functionality of other application as
if you are working with in that application.