Documente Academic
Documente Profesional
Documente Cultură
2201-2412
INTRODUCTION TO
Visual Basic 6.0
Introduction to VB
Analyzing VB Programs
Controls & Properties
Examining Labels, Buttons & Text Boxes
Putting Code into Visual Basic
Message & Input Boxes
Making Decisions
VB Looping
List Boxes & Data Lists
Additional Controls
Modular Programming
Built-In Functions
VB Database Basics
Menus & VB
The Graphics Image Controls
Toolbars & More Graphics
Database Connectivity & Programming
Copyright Mr.Anjan Mahanta LCCT International Studies Program 2
Introduction to Visual Basic 6.0
What is Visual Basic?
Creates Graphic User Interface (GUI)
Creates applications for the Microsoft Windows OS
Major components:
1. Forms
2. Controls
3. Commands
4. Objects
What is a Toolbox?
The toolbox contains the controls that you
place on the Form Window. All the controls
appear on the toolbox.
Label
Text
Text Box Button
Command
Box
Command Button
Number 1
Click on ADD
• Label
– A label control is used to display text that a user can’t
change directly.
• Textbox
– A textbox control is used to input data from the user at run
time.
• Command button
– A command button is used to perform an event at run time.
Operator Meaning
= Equal to
> Greater than
< Less Than
<> Not Equal to
If conditions Then
VB expressions
Else
VB expressions
End If
Text Box
Command Button
Label1
Option 1 Option 4
Option 2 Option 5
Option 3 Option 6
Example:
Dim firstname as string
Copyright Mr.Anjan Mahanta LCCT International Studies Program 50
Branching and Looping
• Example 1
Msgbox “Sorry !!”, vbcritical, “Error”
• Example 2
Msgbox “Correct Password”, vbinformation, “Check”
Label
Text Box Command Button
• Double click on OK
• Double Click on OK
List Box
End Sub
Timer
Label
Interval 600
Label
Text Box
Command
Button
Text Box
Label
Frame
Option Button
Combo Box
Menu Caption
Menu Name
Step 2
• Design the following form in VB
Text Box
Data
S_Code Number
Name Text
G_Vb Text
G_Datastructure Text
G_P_A Text
FieldName DataType
Code Autonumber
Name Text
Score Number
• Select Data1
• In the property of Data1,
• Database name Quiz
• Recordsource Computer_Quiz