Chapter-1 Introduction to Visual Basic GUIA GUI is a graphical
(rather than purely textual) user interface to a computer. The term
came into existence because the first interactive user interfaces
to computers were not graphical; they were text-and-keyboard
oriented and usually consisted of commands you had to remember. The
command interface of the DOS operating system (which you can still
get to from your Windows operating system) is an example of the
typical usercomputer interface (character/command user
interface-CUI) before GUIs arrived. An intermediate step in user
interfaces between the command line interface and the GUI was the
non-graphical menu-based interface, which let you interact by using
a mouse rather than by having to type in keyboard commands. Today's
major operating systems provide a graphical user interface.
Applications typically use the elements of the GUI that come with
the operating system and add their own graphical user interface
elements and ideas.
Programming languagesThere are various types of programming
languages, each was developed to solve a particular kind of
problems. 1. Procedural languagesA computer programming language
that follows, in order, a set of commands. Examples of computer
procedural languages are BASIC, C, FORTRAN, and Pascal. 2. Object
Oriented programming languageA type of programming in which
programmers define not only the data type of a data structure, but
also the types of operations (functions) that can be applied to the
data structure. In this way, the data structure becomes an object
that includes both data and functions. In addition, programmers can
create relationships between one object and another. For example,
objects can inherit characteristics from other objects.
3. Event Driven programming languageIn computer programming,
event-driven programming also known as event-based programming is a
programming method in which the flow of the program is determined
by user actions such as mouse clicks, key presses.
VB EnvironmentVB is event-driven programming language, which has
some of the features of object oriented programming language. In VB
you will work with objects, which has properties and methods.
ObjectsObject is an element from a VB program, such as a control,
form or code module that holds programming statement. PropertiesA
Property helps to differentiate a control from other control
because the property shows appearance and behavior of a control.
Properties have values such as colors, names, size and location on
the form. MethodsActions associated with the objects are called
methods. Some common methods are move, print, show etc. EventEach
action by the user causes an event, Event is an activity that
occurs during program execution, such as mouse click, key-press,
activate etc.
VB EnvironmentAn integrated development environment (IDE) is a
programming environment that has been packaged as an application
program, typically consisting of a code editor, a compiler, a
debugger, and a graphical user interface (GUI) builder. Main
Window- Title bar, Menu bar & tool bar Tool Box Form Window
Project Explorer Properties window Form Layout window
Visual Basic Projects-
The Project file with extension .vbp Each form in project saved
with extension .frm Optionally you can have .bas files that
contains basic statement accessed from any form of the project.
(These files are also called standard code module) If you include
additional controls which are not part of standard control set then
the .ocx file names will be included in your project. After you
save a project, VB automatically adds one or more files to your
project with extension .vbw(VB project workplace). This file holds
information about each of your projects form.
Errors in VB1. Compile time errors- (Occurs when you press enter
key or when you execute code) Project code->m/c code=>Compile
time errors if you break syntax rule Ex. if a