Home   Visual Basic 5/6 Programming Tutorials   Learn Visual Basic 6   Table of Contents


Learn Visual Basic 6 - Table of Contents

1. Introduction to the Visual Basic Environment

Preview 1-1
Course Objectives 1-2
What is Visual Basic? 1-2
Visual Basic 6 versus Other Versions of Visual Basic 1-4
Structure of a Visual Basic Application 1-5
Steps in Developing Application 1-6
Drawing the User Interface and Setting Properties 1-7
Example 1-1: Stopwatch Application - Drawing Controls 1-11
Setting Properties of Objects at Design Time 1-12
Setting Properties at Run Time 1-13
How Names Are Used in Object Events 1-13
Example 1-2: Stopwatch Application - Setting Properties 1-14
Writing Code 1-16
Variables 1-17
Visual Basic Data Types 1-17
Variable Declaration 1-18
Example 1-3: Stopwatch Application - Attaching Code 1-21
Quick Primer on Saving Visual Basic Applications 1-24
Class Review 1-25
Practice Problems 1 1-26
Problem 1-1. Beep Problem
Problem 1-2. Caption Problem
Problem 1-3. Enabled Problem
Problem 1-4. Date Problem
Exercise 1: Calendar/Time Display 1-27

2. The Visual Basic Language

Review and Preview 2-1
A Brief History of Basic 2-2
Visual Basic Statements and Expressions 2-3
Visual Basic Operators 2-4
Visual Basic Functions 2-5
String Functions 2-6
Rnd (Random Number) Function 2-9
Example 2-1: Savings Account 2-10
Visual Basic Symbolic Constants 2-14
Defining Your Own Constants 2-14
Visual Basic Branching - If Statements 2-15
Key Trapping 2-16
Example 2-2: Savings Account - Key Trapping 2-18
Select Case - Another Way to Branch 2-20
The GoTo Statement 2-21
Visual Basic Looping 2-21
Visual Basic Counting 2-23
Example 2-3: Savings Account - Decisions 2-24
Class Review 2-27
Practice Problems 2 2-28
Problem 2-1. Random Number Problem
Problem 2-2. Price Problem
Problem 2-3. Odd Integers Problem
Problem 2-4. Pennies Problem
Problem 2-5. Code Problem
Exercise 2-1: Computing a Mean and Standard Deviation 2-29
Exercise 2-2: Flash Card Addition Problems 2-30

3. Exploring the Visual Basic Toolbox

Review and Preview 3-1
The Message Box 3-2
Object Methods 3-4
The Form Object 3-5
Command Buttons 3-6
Label Boxes 3-6
Text Boxes 3-7
Example 3-1: Password Validation 3-9
Check Boxes 3-12
Option Buttons 3-12
Arrays 3-13
Control Arrays 3-14
Frames 3-15
Example 3-2: Pizza Order 3-16
List Boxes 3-21
Combo Boxes 3-22
Example 3-3: Flight Planner 3-24
Class Review 3-28
Practice Problems 3 3-29
Problem 3-1. Message Box Problem
Problem 3-2. Tray Problem
Problem 3-3. List Box Problem
Problem 3-4. Combo Box Problem
Exercise 3: Customer Database Input Screen 3-30

4. More Exploration of the Visual Basic Toolbox

Review and Preview 4-1
Display Layers 4-2
Line Tool 4-3
Shape Tool 4-4
Horizontal and Vertical Scroll Bars 4-5
Example 4-1: Temperature Conversion 4-8
Picture Boxes 4-13
Image Boxes 4-15
Quick Example: Picture and Image Boxes 4-16
Drive List Box 4-16
Directory List Box 4-17
File List Box 4-17
Synchronizing the Drive, Directory, and File List Boxes 4-18
Example 4-2: Image Viewer 4-19
Common Dialog Boxes 4-24
Open Common Dialog Box 4-25
Quick Example: The Open Dialog Box 4-27
Save As Common Dialog Box 4-29
Quick Example: The Save As Dialog Box 4-30
Class Review 4-31
Practice Problems 4 4-32
Problem 4-1. Tic-Tac-Toe Problem
Problem 4-2. Number Guess Problem
Problem 4-3. File Times Problem
Exercise 4: Student Database Input Screen 4-33

5. Creating a Stand-Alone Visual Basic Application

Review and Preview 5-1
Designing an Application 5-2
Using General Sub Procedures in Applications 5-3
Creating a Code Module 5-6
Using General Function Procedures in Applications 5-6
Quick Example: Temperature Conversion 5-8
Quick Example: Image Viewer 5-9
Adding Menus to an Application 5-9
Example 5-1: Note Editor 5-13
Using Pop-Up Menus 5-18
Assigning Icons to Forms 5-19
Designing Your Own Icon with IconEdit 5-19
Creating Visual Basic Executable Files 5-21
Example 5-2: Note Editor - Building an Executable
and Attaching an Icon 5-23
Using the Visual Basic Package & Deployment Wizard 5-24
Example 5-3: Note Editor - Creating a Distribution Disk 5-28
Class Review 5-29
Practice Problems 5 5-30
Problem 5-1. Normal Numbers Problem
Problem 5-2. Loan Problem
Problem 5-3. Pop-Up Menu Problem
Exercise 5: US/World Capitals Quiz 5-32

6. Error-Handling, Debugging and File Input/Output

Review and Preview 6-1
Error Types 6-2
Run-Time Error Trapping and Handling 6-3
General Error Handling Procedure 6-5
Example 6-1: Simple Error Trapping 6-8
Debugging Visual Basic Programs 6-10
Example 6-2: Debugging Example 6-11
Using the Debugging Tools 6-12
Debugging Strategies 6-17
Sequential Files 6-18
Sequential File Output (Variables) 6-19
Application Path 6-21
Quick Example: Writing Variables to Sequential Files 6-22
Sequential File Input (Variables) 6-23
Quick Example: Reading Variables from Sequential Files 6-24
Writing and Reading Text Using Sequential Files 6-25
Random Access Files 6-27
User-Defined Variables 6-29
Writing and Reading Random Access Files 6-30
Using the Open and Save Common Dialog Boxes 6-32
Example 6-3: Note Editor - Reading and Saving Text Files 6-34
Class Review 6-38
Practice Problems 6 6-39
Problem 6-1. Debugging Problem
Problem 6-2. Option Saving Problem
Problem 6-3. Text File Problem
Problem 6-4. Data File Problem
Exercise 6-1: Information Tracking 6-41
Exercise 6-2: ‘Recent Files’ Menu Option 6-42

7. Graphics Techniques with Visual Basic

Review and Preview 7-1
Graphics Methods 7-2
Using Colors 7-10
Mouse Events 7-13
Example 7-1: Blackboard 7-16
Drag and Drop Events 7-21
Example 7-2: Letter Disposal 7-23
Timer Tool and Delays 7-26
Animation Techniques 7-28
Quick Example: Simple Animation 7-29
Quick Example: Animation with the Timer Tool 7-30
Random Numbers (Revisited) and Games 7-32
Randomly Sorting N Integers 7-33
Example 7-3: One-Buttoned Bandit 7-34
User-Defined Coordinates 7-39
Simple Function Plotting (Line Charts) 7-40
Simple Bar Charts 7-42
Example 7-4: Line Chart and Bar Chart Application 7-44
Class Review 7-47
Practice Problems 7 7-48
Problem 7-1. Blackboard Problem
Problem 7-2. RGB Colors Problem
Problem 7-3. Drag and Drop Problem
Problem 7-4. Bounce Problem
Problem 7-5. Dice Rolling Problem
Problem 7-6. Plotting Problem
Exercise 7-1: Blackjack 7-49
Exercise 7-2: Information Tracking Plotting 7-50

8. Database Access and Management

Review and Preview 8-1
Database Structure and Terminology 8-2
ADO Data Control 8-6
Connection String 8-8
Assigning Tables 8-9
Data Bound Controls 8-10
Example 8-1: Accessing the Books Database 8-12
Creating a Virtual Table 8-14
Quick Example: Forming a Virtual Table 8-14
Finding Specific Records 8-16
Example 8-2: ‘Rolodex’ Searching of the Books Database 8-18
Data Manager 8-21
Example 8-3: Phone Directory - Creating the Database 8-22
Database Management 8-24
Example 8-4: Phone Directory - Managing the Database 8-26
Custom Data Bound Controls 8-31
Creating a Data Report 8-34
Example 8-5: Phone Directory - Building a Data Report 8-35
Class Review 8-39
Practice Problems 8 8-40
Problem 8-1. New Recordset Problem
Problem 8-2. Recordcount Problem
Problem 8-3. Multiple Authors Problem
Problem 8-4. Northwind Database Problem
Exercise 8: Home Inventory Database 8-41

9. Dynamic Link Libraries and the Windows API

Review and Preview 9-1
Dynamic Link Libraries (DLL) 9-2
Accessing the Windows API With DLL 9-3
Timing with DLL Calls 9-6
Quick Example 1: Using GetTickCount to Build a Stopwatch 9-7
Quick Example 2: Using GetTickCount to Implement a Delay 9-8
Drawing Ellipses 9-9
Quick Example 3: Drawing Ellipses 9-10
Drawing Lines 9-11
Quick Example 4: Drawing Lines 9-13
Drawing Polygons 9-15
Quick Example 5: Drawing Polygons 9-16
Filling a Closed Area 9-19
Quick Example 6. Filling a Closed Area. 9-20
Sounds with DLL Calls 9-22
Quick Example 7: Playing WAV Files 9-23
Playing Sounds Quickly 9-24
Quick Example 8: Playing Sounds Quickly 9-25
Fun With Graphics 9-27
Quick Example 9: Bouncing Ball With Sound! 9-29
Flicker Free Animation 9-30
Quick Example 10: Flicker Free Animation 9-32
Quick Example 11: Horizontally Scrolling Background 9-34
Quick Example 12: Sprite Animation 9-36
Collision Detection 9-40
Quick Example 13: Collision Detection 9-41
Viewing Web Pages 9-44
Quick Example 14. Viewing Web Pages 9-46
Class Review 9-47
Practice Problems 9 9-48
Problem 9-1. Rubber Band Problem
Problem 9-2. Sound File Problem
Problem 9-3. Bouncing Balls Problem
Problem 9-4. Moon Problem
Exercise 9: The Original Video Game - Pong! 9-49

10. Other Visual Basic Topics

Review and Preview 10-1
Custom Controls 10-2
Masked Edit Control 10-4
Chart Control 10-6
Multimedia Control 10-9
Rich Textbox Control 10-11
Slider Control 10-13
Tabbed Dialog Control 10-15
UpDown Control 10-17
Toolbar Control 10-19
Winsock Control – Sending E-Mail 10-23
Using the Windows Clipboard 10-29
Printing with Visual Basic 10-30
Printer Object 10-32
Multiple Form Visual Basic Applications 10-35
Visual Basic Multiple Document Interface (MDI) 10-39
Creating a Help File 10-44
Internet Applications – Adding a Web Browser 10-53
Class Review 10-55
Course Summary 10-56
Practice Problems 10 10-57
Problem 10-1. Social Security Number Problem
Problem 10-2. Chart Problem
Problem 10-3. Rich Textbox Note Editor Problem
Problem 10-4. Loan Printing Problem
Problem 10-5. Note Editor About Box Problem
Problem 10-6. Note Editor Help Problem
Exercise 10: The Ultimate Application 10-58

Practice Problems Solutions P-1
Exercise Solutions E-1
Appendix I: Visual Basic Symbolic Constants I-1
Appendix II: Common Dialog Box Constants II-1

Back to Top

Back to Learn Visual Basic 6


Copyright © 1982-2007 KIDware
All Rights Reserved
Contact Information