Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (2 votes)
2K views

VB Is Event Driven Programming Language

Visual Basic is an event-driven programming language where code is executed in response to events like user clicks or key presses. The Integrated Development Environment (IDE) provides tools to build Visual Basic applications and includes components like the menu bar, toolbox, project explorer, properties window, and form designer. It allows developers to visually design interfaces and write code for applications.

Uploaded by

Gauri
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
2K views

VB Is Event Driven Programming Language

Visual Basic is an event-driven programming language where code is executed in response to events like user clicks or key presses. The Integrated Development Environment (IDE) provides tools to build Visual Basic applications and includes components like the menu bar, toolbox, project explorer, properties window, and form designer. It allows developers to visually design interfaces and write code for applications.

Uploaded by

Gauri
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

VB is event Driven Programming language:

Visual Basic is an event-driven programming language.The


common events are Click, DblClick, Load, MouseMove,
MouseDown, MouseUp, KeyPress, KeyUp, KeyDown,
GotFocus, LostFocus, etc.

When you click, press a key, move the mouse or fire other
events, the particular block of code of the corresponding
event procedure is executed, and then the program behaves
in a certain way. This is called event-driven programming.

When you fire an event, the code in the event procedure is


executed, and then visual basic performs its operations as
per the instructions written in the event procedure code.
For example, in the first sample program, when you click
the 'Print' button, the click event is fired, and then the code
in the click event procedure gets executed. The code tells
Visual Basic to print a text on the form. So as a result, you
see a text printed on the form.
The Integrated Development Environment (IDE)
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 all
of the development tools that we need from one screen called an interface. The
IDE is also commonly referred to as the design environment, or the program.

The Visual Basic IDE is made up of a number of components

 Menu Bar
 Tool Bar
 Project Explorer
 Properties window
 Form Layout Window
 Toolbox
 Form Designer
 Object Browser

In previous versions of Visual Basic, the IDE was designed as a Single


Document Interface (SDI). In a Single Document Interface, each window is a
free-floating window that is contained within a main window and can move
anywhere on the screen as long as Visual Basic is the current application. But,
in Visual Basic 6.0, the IDE is in a Multiple Document Interface (MDI) format.
In this format, the windows associated with the project will stay within a single
container known as the parent. Code and form-based windows will stay within
the main container form.

Figure 1 The Visual Basic startup dialog box


Menu Bar
This Menu Bar displays the commands that are required to build an
application. The main menu items have sub menu items that can be chosen
when needed. The toolbars in the menu bar provide quick access to the
commonly used commands and a button in the toolbar is clicked once to carry
out the action represented by it.

Toolbox
The Toolbox contains a set of controls that are used to place on a Form at
design time thereby creating the user interface area. Additional controls can be
included in the toolbox by using the Components menu item on the Project
menu. A Toolbox is represented in figure 2 shown below.

Figure 2 Toolbox window with its controls available commonly.

Project Explorer
Docked on the right side of the screen, just under the tollbar, is the Project Explorer
window. The Project Explorer as shown in in figure servres as a quick reference to
the various elements of a project namely form, classes and modules. All of the object
that make up the application are packed in a project. A simple project will typically
contain one form, which is a window that is designed as part of a program's interface.
It is possible to develop any number of forms for use in a program, although a
program may consist of a single form. In addition to forms, the Project Explorer
window also lists code modules and classes.

Figure 3 Project Explorer


Properties Window
The Properties Window is docked under the Project Explorer window. The
Properties Window exposes the various characteristics of selected objects. Each and
every form in an application is considered an object. Now, each object in Visual Basic
has characteristics such as color and size. Other characteristics affect not just the
appearance of the object but the way it behaves too. All these characteristics of an
object are called its properties. Thus, a form has properties and any controls placed
on it will have propeties too. All of these properties are displayed in the Properties
Window.

Context Menus

Contain shortcuts to frequently performed actions. To open a context menu, click the
right mouse button on the object you're using. The specific list of shortcuts available
from context menus depends on the part of the environment where you click the right
mouse button. For example, the context menu displayed when you right click on the
Toolbox lets you display the Components dialog box, hide the Toolbox, dock or
undock the Toolbox, or add a custom tab to the Toolbox.

Context menu is also called as popup menu.

Toolbars

Provide quick access to commonly used commands in the programming


environment. You click a button on the toolbar once to carry out the action
represented by that button. By default, the Standard toolbar is displayed when you
start Visual Basic. Additional toolbars for editing, form design, and debugging can
be toggled on or off from the Toolbars command on the View menu.

Toolbars can be docked beneath the menu bar or can "float" if you select the vertical
bar on the left edge and drag it away from the menu bar.

Form Designer

Serves as a window that you customize to design the interface of your application.
You add controls, graphics, and pictures to a form to create the look you want. Each
form in your application has its own form designer window.
Code Editor Window

Serves as an editor for entering application code. A separate code editor window is
created for each form or code module in your application. Code window contains two
dropdown list boxes, One for the list of objects in the form and another for available
events of the selected object.

Form Layout Window

The Form Layout window allows you to position the forms in your application using a
small graphical representation of the screen.
Immediate, Locals, and Watch Windows
These additional windows are provided for use in debugging your application. They
are only available when you are running your application within the IDE.
Project Explorer
Docked on the right side of the screen, just under the tollbar, is the Project
Explorer window. The Project Explorer as shown in in figure servres as a quick
reference to the various elements of a project namely form, classes and modules.
All of the object that make up the application are packed in a project. A simple
project will typically contain one form, which is a window that is designed as
part of a program's interface. It is possible to develop any number of forms for
use in a program, although a program may consist of a single form. In addition
to forms, the Project Explorer window also lists code modules and classes.

Figure 3 Project Explorer

Properties Window
The Properties Window is docked under the Project Explorer window. The
Properties Window exposes the various characteristics of selected objects. Each
and every form in an application is considered an object. Now, each object in
Visual Basic has characteristics such as color and size. Other characteristics
affect not just the appearance of the object but the way it behaves too. All these
characteristics of an object are called its properties. Thus, a form has properties
and any controls placed on it will have propeties too. All of these properties are
displayed in the Properties Window.

Context Menus
Contain shortcuts to frequently performed actions. To open a context menu, click the
right mouse button on the object you're using. The specific list of shortcuts available
from context menus depends on the part of the environment where you click the right
mouse button. For example, the context menu displayed when you right click on the
Toolbox lets you display the Components dialog box, hide the Toolbox, dock or undock
the Toolbox, or add a custom tab to the Toolbox.

Context menu is also called as popup menu.

You might also like