Visual Basic 6.0

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 43

VISUAL BASIC 6.

0
 Visual Basic is a
third-generation event-
driven programming
language first released
by Microsoft in 1991.
 1.0 to the final
What is
version Visual Basic
6.0. Visual Basic?
The Visual Basic 6 Integrated Development
Environment
When you start a new Visual Basic 6 Standard
EXE project, you will be presented with the
Visual Basic 6 Integrated Development
Environment (IDE). The Visual Basic 6
Integrated Programming Environment is shown
in Figure 1.2. It consists of the toolbox,
the form, the project explorer and the
properties window.
COMPONENTS OF IDE (INTEGRATED DEVELOPMENT
ENVIRONMENT
TITLE
BAR
The title bar is the horizontal bar along
the top of the screen.
COMPONENTS OF IDE (INTEGRATED DEVELOPMENT
ENVIRONMENT)
MENU BAR
The Menu Bar is the gateway to the Visual
Basic’s dropdown menu system.
COMPONENTS OF IDE (INTEGRATED DEVELOPMENT
ENVIRONMENT)
FORM
WINDOW
This window, located
in the center of the
screen, is the
cornerstone of your
application’s user
interface..
COMPONENTS OF IDE (INTEGRATED DEVELOPMENT
ENVIRONMENT)
TOOL BAR
A row of icons located horizontally near the
top side of the screen.
COMPONENTS OF IDE (INTEGRATED DEVELOPMENT
ENVIRONMENT)
TOOLBOX
The vertical icon
group located on
the left side of
screen..
COMPONENTS OF IDE (INTEGRATED DEVELOPMENT
ENVIRONMENT)
PROJECT
WINDOW
This window list the
files, forms, and modules
that comprise the current
application.
COMPONENTS OF IDE (INTEGRATED DEVELOPMENT
ENVIRONMENT)
PROPERTIES
WINDOW
This window shows
attributes associated
with a selected form or
control.
COMPONENTS OF IDE (INTEGRATED DEVELOPMENT
ENVIRONMENT)
DEBUG WINDOW
This window appears every
time an application is
executed on run-time.
COMPONENTS OF IDE (INTEGRATED DEVELOPMENT
ENVIRONMENT)
COLOR PALETTE
This window provide the
user the ability to
change the color property
of the form and object in
the application..
(THE STANDARD VISUAL
BASIC CONTROLS)
Toolbox and Form
 The user can place the
tool on form and then
work with the tool. To
place the tool on form:

 Click on tool >Draw tool


to Form> the tool appears
on Form.
Or: double click on it
WORKING WITH
TOOLS
• The user can work with tool in the design stage.----
Propertyname
• To add tool: double click on tool. Tool appears on form or
drags it to designpart of page and draw it in the desired
size.
• To delete: click on element in page> press delete key of the
key board or right click on object for mouse list> choose
delete.
• To display tool properties window: click on element>
properties window Appear.
• To display code form: double click on tool code form for
that element.
THE STANDARD VISUAL BASIC CONTROLS

LABEL
 It is used to display fixed text on
form

Note: The available color numbers that used with


QBcolor is the integers 0 to 15 only.
THE STANDARD VISUAL BASIC CONTROLS
Example: Design a form contains label “Visual Basic” in
size 14.
THE STANDARD VISUAL BASIC CONTROLS
TextBox

Can be used to display text but


also enables users to enter or
edit new pr existing text.
THE STANDARD VISUAL BASIC CONTROLS
TextBox Properties
THE STANDARD VISUAL BASIC CONTROLS
Try Example: Design a form to enter username and
password such that the title of the form is VB.
this!
THE STANDARD VISUAL BASIC CONTROLS
COMMAND BUTTON
 It acts as a switch. To deal with tool property>
click on command button> property window appear>
change setting of any desired property. Usually
change set its caption property to a suitable
string.

 To make the button functional, the user should add


some code. To do this: click on command tool> code
form appears with click event procedure. Write
code in this event or other events like press key
event
THE STANDARD VISUAL BASIC CONTROLS
THE STANDARD VISUAL BASIC CONTROLS
Example: Design a form with label, such that when click on the
command button "name "your name appears on label(at running stage).
Try this!
Design a form to appear
your name and section
in textbox, when click
on command button
"name“ and “section“
respectively so that
they can clear these
information when click
on command "clear" and
stop project when click
on command "exit".
OPTION BUTTON

Used only as a group of


buttons. When the user
selects one of them the
others are deselected
automatically
OPTION BUTTON

Example: Design a form with


three option buttons " red ", "
green " and " blue “ such that
when we click on options the
color of the form colored by
red, green and
blue respectively.
CHECK BOX
Any number of check boxes
can be used on a form.
They work independently.
Its Property value could
be changed in design stage
manually, or in running
stage by
code.
CHECK BOX
Example: Design a form
with one text box and
three check boxes such
that when
click on boxes the
following is done: change
typing to bold, italic,
underline
Lesson 10 : Built-in
Functions
In programming, a function is comparable to a
procedure, but it serves a distinct purpose. While
both accept input and perform specific actions, the
primary objective of a function is to receive user
input, process it, and return a value that is
subsequently utilized by the main program to
complete its execution
In this lesson, you will learn two very basic but useful internal
functions of Visual basic , i.e. the MsgBox( ) and InputBox ( )
functions.
Lesson 10 : Built-in
Functions
MsgBox ( ) Function

The objective of MsgBox is to produce


a pop-up message box that prompt the
user to click on a command button
before he /she can continues. The
format is as follows:
yourMsg=MsgBox(Prompt,Style Value, Title)
Lesson 10 : Built-in Functions

Structure:

MsgBox(Prompt,Style Value,
Title)
Prompt - will display the message in
the message box.
Style Value - will determine what type of
command buttons appear on the message box

Title - will appear at the top of message


box
COMMAND BUTTON STYLE FOR
MESSAGE BOX Table 1
ICONS FOR MESSAGE BOX
Table 2
TABLE 3
BHERMAR G. BANAL
Input - output boxes

a) Inputbox

Inputbox used to input value or characters


for one variable from keyboard at running
stage.

This box needs a code in code sheet and could


be written in any event or command

X=inputbox(" prompt or remark", "title")


Input - output boxes
Try this!
Create a program that will
input your complete name using
input box and display the
output using msgbox.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy