LESSON 1 INTRODUCTION TO VISUAL BASIC ................................................................................1
1.1 A Brief Description of Visual Basic ..................................................................................................................1
1.2 The Visual Basic Environment .........................................................................................................................2
LESSON 2 BUILDING THE VISUAL BASIC APPLICATIONS ............................................................5
2.1 Creating Simple Visual Basic Applications.....................................................................................................5
2.2 Steps in Building a Visual Basic Application ................................................................................................10
LESSON 3 WORKING WITH CONTROLS .........................................................................................13
3.1 The Properties of the Controls .......................................................................................................................14
LESSON 4 WRITING THE CODES.....................................................................................................23
LESSON 5 VISUAL BASIC DATA ......................................................................................................27
5.1 Types of Visual Basic Data.............................................................................................................................27
LESSON 6 MANAGING VISUAL BASIC DATA.................................................................................31
6.1 Assigning Values to the Variables.................................................................................................................31
6.2 Arithmetic Operators in Visual Basic.............................................................................................................31
LESSON 7 CONTROLLING PROGRAM FLOW – PART I..................................................................35
7.1 Conditional Operators .....................................................................................................................................35
7.2 Logical Operators.............................................................................................................................................35
7.3 Using If.....Then.....Elseif….Else Statements with Operators ....................................................................36
LESSON 8 CONTROLLING PROGRAM FLOW – PART II................................................................41
8.1 The Select Case …. End Select Statement .................................................................................................41
LESSON 9 LOOPING PART I .............................................................................................................46
9.1 Do….. Loop......................................................................................................................................................46
9.2: Exiting the Do Loop ........................................................................................................................................49
9.3 The While….Wend Loop.................................................................................................................................50
LESSON 10 LOOPING PART II ...........................................................................................................52
10.1 The For....Next Loop .....................................................................................................................................52
10.2 Exiting the For….Next Loop .........................................................................................................................54
10.3 The Nested Loop ...........................................................................................................................................55
LESSON 11 VISUAL BASIC FUNCTIONS- PART I............................................................................58
11.1 Introduction to Visual Basic Functions........................................................................................................58
11.2 The MsgBox ( ) Function ..............................................................................................................................58
11.3 The InputBox( ) Function ..............................................................................................................................62
LESSON 12 VISUAL BASIC FUNCTIONS- PART II...........................................................................64
12.1 The Rnd Function ..........................................................................................................................................64
12.2 The Numeric Functions.................................................................................................................................67
12.3 Trigonometric Functions ...............................................................................................................................69
LESSON13 VISUAL BASIC FUNCTIONS PART III- FORMATTING OUTPUT 71
13.1 The Tab Function..........................................................................................................................................71
13.2 The Space Function ......................................................................................................................................73
13.3 The Format Function...................................................................................................................................74
13.4 Formatting Date and Time............................................................................................................................77
LESSON14 VISUAL BASIC FUNCTIONS PART IV- MANIPULATING STRINGS 80
14.1 The Len Function..........................................................................................................................................81
14.2 The Right Function .......................................................................................................................................82
14.3 The Left Function...........................................................................................................................................82
14.4 The Ltrim Function.........................................................................................................................................82
III
14.5 The Rtrim Function........................................................................................................................................82
14.6 The Trim function...........................................................................................................................................82
14.7 The Mid Function ...........................................................................................................................................83
14.8 The InStr function ..........................................................................................................................................83
14.9 The Ucase and the Lcase functions............................................................................................................83
14.10 The Str and Val functions ...........................................................................................................................83
14.11 The Chr and the Asc functions ..................................................................................................................83
LESSON 15 VISUAL BASIC FUNCTIONS PART V- CREATING YOUR OWN FUNCTIONS 81
LESSON 16 CREATING VISUAL BASIC FUNCTIONS FOR MS EXCEL..........................................91
16.1 The Needs to Create User-Defined Functions in MS-Excel ....................................................................91
16.2 Using Microsoft Excel Visual Basic Editor.................................................................................................92
LESSON 17 ARRAYS PART I..............................................................................................................96
17.1 Introduction to Array......................................................................................................................................96
17.2 Declaring Arrays ............................................................................................................................................96
17.3 The Control Array ..........................................................................................................................................99
LESSON 18 ARRAYS PART II- TWO DIMENSIONAL ARRAYS .......................................................96
LESSON 19 GRAPHICS.....................................................................................................................104
19.1 The line and Shape controls ......................................................................................................................104
19.2 The Image Box and the Picture Box .........................................................................................................107
19.3 PSet, Line and Circle Drawing Methods...................................................................................................109
LESSON 20 CREATING MULTIMEDIA APPLICATIONS .................................................................120
20.1 Creating a CD Player ..................................................................................................................................120
20.2 Creating an Audio Player............................................................................................................................123
20.3 Creating a Multimedia Player.....................................................................................................................128
LESSON 21 ANIMATION - PART I ....................................................................................................139
LESSON 22 ANIMATION - PART II ...................................................................................................139
22.1 Animation using a drag and drop procedure............................................................................................139
22.2 Animation with complete motion................................................................................................................140
LESSON 23 ANIMATION - PART III ..................................................................................................144
23.1 Animation using timers................................................................................................................................144
23.2 Animation using the Move Method............................................................................................................147
LESSON 24 FUN AND GAMES PROGRAMMING- PART I..............................................................170
24.1 Snake Chess ................................................................................................................................................148
24.2 The Slot Machine.........................................................................................................................................148
LESSON 25 FUN AND GAMES PROGRAMMING- PART II.............................................................170
25.1 Boggle ...........................................................................................................................................................170
25.2 Reversi ..........................................................................................................................................................172
25.3 Calculator......................................................................................................................................................180
LESSON 27 WORKING WITH FILES ................................................................................................212
27.1 Introduction...................................................................................................................................................212
27.2 Creating a Text File .....................................................................................................................................212
27.3 Reading a File ..............................................................................................................................................213
LESSON 28 CREATING BASIC DATABASE APPLICATIONS IN VISUAL BASIC ........................219
LESSON 29 CREATING DATABASE APPLICATIONS USING ADO CONTROL ...........................223
LESSON 30 INTERNET AND WEB APPLICATIONS .......................................................................238
30.1 The Web Browser........................................................................................................................................242
30.2 The FTP prog