You are on page 1of 26

INTRODUCTION TO VISUAL

BASIC

PRESENTED BY :
Dr.R.Gunasundari
Professor
Department of Computer Applications
Karpagam Academy of Higher Education
Coimbatore
Objectives

 Machine language vs.. High-level language


 Procedure-oriented, object-oriented, and
event-driven languages
 Background of Visual Basic
 VB Integrated Development Environment
 Online documentation and Help features
Application Programs
Program - detailed set of instructions for a
computer to execute
Application programs (applications or apps) -
self-contained collection of programs that
perform a task for the end user
Programming language - formal language used
to give instructions to computers
History of Programming
Languages

 Machine language - ALP


 Procedure-oriented languages
 Object-oriented languages
 Event-driven languages
 Natural languages
History of Programming
Languages

 Machine Language
 different for each computer processor
 Procedure-Oriented Languages
 FORTRAN
 COBOL
 Pascal
 C
 Ada
History of Programming
Languages

 Object-oriented languages
 Smalltalk
 C++
 Ada 95
 Event-driven languages
 VisualBasic
 most Visual languages
History of Programming
Languages

 Natural languages
 computer will accept a user’s native or
natural language, such as English
 Researchers continue to work in this
area
eg :Spell check, Autocomplete, Voice text
messaging, Spam filters, Related keywords on
search engines
Background of Visual Basic

 BASIC
 Beginner’sAll-purpose Symbolic
Instruction Code
 Designed to teach programming to
beginners
 BASIC language interpreter, one of
Microsoft’s first products
Background of Visual Basic

 BASIC
 Included with DOS
 QBASIC - included with DOS Version 5 -
subset of BASIC
 Visual Basic
 1992 - Visual Basic 1 for Windows 3
 Visual Basic 4 - for Windows 95
 Visual Basic 5 - for Office 97
 Visual Basic 6 - for Windows 98 & Office 2000
Visual Basic Editions

 Learning Edition
 Professional Edition
 Enterprise Edition
 Included in Visual Studio suite
(analogy Office for programmers)
Visual Basic Editions

 Other Visual Basic packaging options


 VBA (Visual Basic for Applications)
 Windows CE Toolkit for Visual Basic
 Visual Basic Scripting Edition
 Control Creation Edition
Visual Basic 6 Interactive Development Environment

Project
Toolbox Explorer

Form
Designer
Window

Properties
window

Code Editor
Window

Form Layout
Window
Elements of the Integrated
Development Environment

 Application icon  Major windows


 Application name  Form Designer
 Form Layout
 Context menus
 Toolbox
 Controls
 Project Explorer
 Current project  Object Browser
 Design view mode  Properties
 Title bar  Code Editor
 Immediate, Locals, Watch
Introduction to Visual Basic

Hands-On Exercise 1
 Start Microsoft Visual Basic 6.0
 Open the Welcome Project
 Open the Welcome Form
 Run the Welcome Project
 End the Welcome Project
 Exit Visual Basic
Get Help When You Need It

 MSDN Library
 Microsoft on the Web
 Learning Edition of Visual Basic 6.0
 Visual Basic 6.0 in Action book
 Learn Visual Basic Now multimedia
tutorial
MSDN Library

Navigation Topic Pane


Pane
MSDN Library
 Visual Basic Documentation
 Documentation Map
 What’s New
 Programmer’s Guide
 Samples
 Reference Guidebooks
 Component Tools Guide
 Data Access Guide
Integrated Development
Environment
 Integrated Development Environment
includes
 Form Designer, Form Layout
 Code Edition, Project Explorer
 Properties and Object Browser
Simple Program: Printing a
Line of Text
 Simple program that displays a line of text
 When the program is run
 output appears in a command window
 It illustrates important Visual Basic
features
 Comments
 Modules
 Sub procedures

19
Simple Program: Printing a Line
of Text
1. Create the console application
 Select File > New > Project…
 In the left pane, select Visual Basic Projects
 In the right pane, select Console Application
 Name the project Welcome1
 Specify the desired location
2. Change the name of the program file
 Click Module1.vb in the Solution Explorer
window
 In the Properties window, change the File Name
property to Welcome1.vb
20
Simple Program: Printing a Line of Text
Left pane Right pane

Project
name

File
location

Fig. Creating a Console Application with the New Project dialog.

21
Simple Program: Printing a Line
of Text
Editor window (containing
program code)

Fig. IDE with an open console application.


22
Simple Program: Printing a
Line of Text
Solution Explorer

Click Module1.vb to
display its properties

Properties window

File Name
property

Fig. Renaming the program file in the Properties window.

23
Simple Program: Printing a
Line of Text

4. Change the name of the module


 Module names must be modified in the editor
window
 Replace the identifier Module1 with
modFirstWelcome
 Writing codeType the code contained in line 7 of
Fig. between Sub Main() and End Sub
 Note that after typing the class name and the dot
operator the IntelliSense is displayed. It lists a
class’s members.
 Note that when typing the text between the
parenthesis (parameter), the Parameter Info and
Parameter List windows are displayed
Simple Program: Printing a
Line of Text
Omitted parenthesis character (syntax
error)

Blue underline
indicates a syntax
error

Task List window

Error description(s)

Fig. 3.8 IDE indicating a syntax error.

26

You might also like