Introduction, Generations of computer, Visual Basic environment, Code window, Properties Window, IDE, Form Window, Starting an Application,Adding an Image Control, Running an Application
1. VISUAL PROGRAMMING
STAFF NAME : D.SARITHA
ASSISTANT PROFESSOR
DEPARTMENT OF COMPUTER APPLICATIONS
BON SECOURS COLLEGE FOR WOMEN
THANJAVUR
UNIT : I
CHAPTER : 1
TOPIC : INTRODUCTION TO VISUAL BASIC
5. WHAT IS VISUAL BASIC?
High Level 4th Generation Programming
Language
Object and Event Driven
Visual - Windows Based
Integrated Development Environment or IDE
6. WHAT IS VB USED FOR?
Most Popular Programming Language
Stand alone programs
Applets that can be run on many different
kinds of computers
Customized specialized Applications
E- Commerce
Web based shopping forms and inquiries
User friendly Interface to applications
7. l l l l l l
Used by a computer equipment retail outlet to
record data regarding customer orders.
EXAMPLE ORDER ENTRY SCREEN
Allows user to use a mouse to click on boxes for text entry.
Also enables user to click on buttons
to initiate processing steps.
8. GENERATIONS OF COMPUTER LANGUAGES
1st - Machine language - 0110 0011 1000
2nd - Procedure-oriented languages
FORTRAN - 1954 for scientists and engineers
COBOL - 1959 for business applications
C - 1972 - for UNIX operating systems
3rd - Object-oriented languages
4th - Event-driven languages - i.e.VB
5th - Natural languages i.e. English
9. COMPILER VS INTERPRETER
Higher Languages are translated to
Machine Language by:
Interpreter
Translates instructions to machine code line-by-
line.
BASIC, Quick Basic, Visual Basic
Compiler
Translates the entire program to machine code
before running it.
Fortran, C, C++, Visual Basic is also a compiler
10. WHAT ARE THE OBJECTS IN VB?
Pre-programmed Code
for:
Command Buttons
Labels
Pictures
Text Boxes
Have both data and
procedures wrapped
together
11. WHAT ARE THE EVENTS?
Visual Basic “watches” what the user does
A user activity is called an event
Events include mouse clicks and moves, menu
selections, button presses, etc.
Sections of code are only executed in response to
an event
12. WHAT IS THE INTEGRATED DEVELOPMENT
ENVIRONMENT (IDE)?
13. VISUAL BASIC ENVIRONMENT
GUI (Graphical User Interface) - forms and
windows that the user sees
Property - a characteristic or attribute of an object
such as color and size
Event - a user action such as clicking a button
Code Editor window - editor specially designed to
help you when writing code
16. THE CODE EDITOR WINDOW
Object List Box
Procedure List Box
Auto List Members
Full Module View
button
17. THE CODE EDITOR WINDOW
Help
window
Error message box
Syntax error in Red
Procedure view button
18. VB ENVIRONMENT: PROJECT WINDOW
The Project Window can be used to navigate
between the code and form window for each form
/ window a project has
19. VB ENVIRONMENT: MENU BAR
The Menu Bar consists of 3 elements the
Title Bar, which holds the name of application, default
if Microsoft Visual Basic [design]
Menu Bar, this is the link to Visual Basics menu
facilities, each menu option drops down into sub-
menus
Toolbar, contains icons which give access to the more
commonly used commands (which are also available
through the menu bar)
Title bar Menu Bar Toolbar
20. VB ENVIRONMENT: PROPERTIES WINDOW
Used to set how a control
looks and
behaves
Holds its default values
22. VB ENVIRONMENT: CONTEXT SENSITIVE
HELP
Context sensitive help is very useful
Select the item control that you want help on
Press the F1 key
F1
23. THE FILE MENU
Project commands
Make executable commands
Most recent project list
Exit command
24. THE FILE MENU
New Project
Open Project
Add Project
Remove Project
Save Project
Save Project As
Save Component
Save Component As
Print
Print Setup
25. THE FILE MENU
Template - particular pattern for a project or a project
element; start a project from a template saves
time
Existing tab - displays VB projects
Recent tab - displays most recently accessed
projects
Project Groups - a collection of several projects
26. BUILDING YOUR FIRST APPLICATION
There are three primary steps in building a
Visual Project:
Place (or draw) controls on the form.
Assign properties to the controls.
Write event procedures for the controls.
27. PROJECT FILES
vbp extension = Visual Basic Project
file that tracks all components
frm extension = Form file
separate file for each form
frx extension = Binary form file
cannot be read by humans
vbw extension = Visual Basic workspace
28. VISUAL BASIC PROGRAM STRUCTURE
Project File
◦ ‘.VBP’
Form Files
◦ ‘.FRM’
◦ ‘.FRX’
Modules
◦ ‘.BAS’
Custom
Controls
◦ ‘.VBX’ files
Save As...
◦ Possible
problem