Cover image for Practical Visual Basic 6
Practical Visual Basic 6
Reselman, Bob.
Publication Information:
Indianapolis, Ind. : Que, [1999]

Physical Description:
xvi, 838 pages : illustrations ; 23 cm + 1 computer optical disc (4 3/4 in.)
General Note:
Includes index.
Title Subject:
Added Author:
Format :


Call Number
Material Type
Home Location
Item Holds
QA76.73.B3 P72 1999 Book and Software Set Central Closed Stacks

On Order



Practical Visual Basic 6 takes a straightforward, no-nonsense approach to teaching Visual Basic programming, broken into five sections.

Author Notes

Bob Reselman is a senior software engineer at Gateway 2000, where he is involved with designing platform architecture. Bob also teaches object-oriented programming with Visual Basic at Western Iowa Technical Community College. Bob has been programming with Visual Basic since version 1.0.
Richard Peasley is a principal consultant at Cap Gemini, a worldwide consulting organization that helps businesses achieve transformation through technology. Richard is practicing in the Information Technology Solutions Architecture group.

Table of Contents

Introductionp. 1
Why This Book?p. 2
How to Use This Bookp. 2
How This Book Is Organizedp. 3
Conventions Used in This Bookp. 7
I Visual Basic Fundamentals
1 Building Your First Applicationp. 13
Writing Your First Applicationp. 14
Starting Visual Basicp. 14
Building the Calendar Featurep. 15
Adding a Clock Featurep. 18
Configuring the Timer Controlp. 20
Using the Label Control to Display the Timep. 21
Adding a Messagep. 22
Improving Your First Applicationp. 26
2 What's New with Visual Basic 6p. 31
Getting a Quick Overview of VB6p. 32
Getting More Power from Enhanced Controlsp. 32
Working with the New Controlsp. 36
Working with the New Language Featuresp. 39
Learning About VB and the Internetp. 43
Finding Out About the New Data Capabilitiesp. 44
New Object Programming Additionsp. 46
3 Working in the Visual Basic 6 Programming Environmentp. 49
Understanding the Parts of the IDEp. 50
Adding and Removing Toolbars in the Visual Basic IDEp. 51
Adding Controls with the ToolBoxp. 57
Navigating Through the Form Window and Code Windowp. 60
Managing Applications with the Project Explorerp. 61
Controlling Settings with the Properties Windowp. 62
Setting Form Position with the Form Layout Windowp. 63
Viewing the IDEp. 64
4 Using the Intrinsic Controlsp. 67
What Are Forms and Controls?p. 68
What Are Intrinsic Controls?p. 68
Adding and Removing Controlsp. 70
The Importance of Naming Controlsp. 72
How to Size and Position a Controlp. 74
Modifying a Form's Sizep. 75
Working with Containersp. 75
Extending Visual Basic by Adding Controlsp. 76
5 Working with Projects in Visual Basic 6p. 79
What Is a Visual Basic Project?p. 80
Using the Project Explorerp. 80
Creating a New Projectp. 82
Changing a Project's Propertiesp. 83
Saving and Naming a Projectp. 84
Opening an Existing Projectp. 85
Adding Files to a Projectp. 85
Removing Files from a Projectp. 86
Using Project Groupsp. 87
6 Working with Properties, Methods, and Eventsp. 89
What Are Properties, Methods, and Events?p. 90
The Relationship Between Properties, Methods, and Eventsp. 93
The Importance of Event-Driven Programmingp. 94
Using Properties, Methods, and Events in a Sample Programp. 96
II Programming with Visual Basic
7 Using Data Types, Constants, and Variablesp. 109
Storing Information in Variablesp. 110
Making Explicit Declarationsp. 117
Using Type Suffixes with Variablesp. 120
Using Stringsp. 121
Determining Where a Variable Can Be Usedp. 123
Using Static Variablesp. 126
Using Constantsp. 126
Using the Assignment Statementp. 128
Revisiting the Addition Programp. 129
8 Making Statements in a Programp. 131
Using the Assignment Statementp. 132
Using Variable Default Valuesp. 133
Using Math Operatorsp. 134
Setting the Order of Precedence in Statementsp. 141
Concatenating Stringsp. 142
9 Working with Conditional Statementsp. 145
Making Decisions in Your Programp. 146
Writing If...Then Statementsp. 146
Using the Select Case Statementp. 153
10 Working with Loopsp. 159
Putting Loops to Workp. 160
Using For...Next Loopsp. 160
Using Do...Loop Statementsp. 166
Breaking an Infinite Loopp. 171
Nesting Loopsp. 172
11 Working with Arraysp. 181
What Is an Array?p. 182
Declaring Arraysp. 183
Changing the Number of Elements in an Arrayp. 185
Multidimensional Arraysp. 188
Using Loops to Traverse an Arrayp. 191
Adding Items to ListBoxes and ComboBoxesp. 193
Selecting Items from a Listp. 196
Removing Items from a Listp. 198
Clearing a Listp. 199
Understanding ComboBox Stylesp. 199
Using Arrays, ComboBoxes, and ListBoxes in a Sample Programp. 201
Examining ScoreKeeper's Event Proceduresp. 202
12 Working with Strings and Typecastingp. 211
Manipulating Stringsp. 212
Using Strings and Arrays of Stringsp. 226
Changing a String's Case with UCase and LCasep. 233
Using String-Parsing Functionsp. 235
Controlling Data Types with Typecastingp. 240
Validating Data with IsNumericp. 242
III The Elements of Visual Basicp. 6
13 Creating Menus in Your Programsp. 247
Understanding the Windows Standard Menusp. 248
Using Visual Basic's Application Wizardp. 249
Using Visual Basic's Menu Editorp. 253
Creating Complex Menusp. 260
14 Enhancing Your Programs with Forms and Dialog Boxesp. 267
Creating Message Boxes with the MsgBox Function and the MsgBox Statementp. 268
Using Predefined Formsp. 275
Getting User Input from the CommonDialog
Controlp. 276
Making a Simple MDI Applicationp. 285
15 Handling Keyboard and Mouse Input in Your Programsp. 291
Understanding Device Inputp. 292
Working with the KeyPress Eventp. 293
Understanding Mouse Inputp. 303
16 Working with Time and Timersp. 317
Understanding Serial Timep. 318
Understanding the Timer Controlp. 318
Using the Time, Date, and Now Functionsp. 320
Use a Timer to Build a Clock Programp. 321
Using the Format Functionp. 324
Calculating Date Differencesp. 326
Using Static Variables with a Timerp. 329
17 Adding Graphics to Your Programsp. 333
Adding Graphics to a Formp. 334
Changing a Picture at Runtimep. 336
Making a Custom Buttonp. 336
Adding Graphics to Forms with LoadPicturep. 339
Making a Form Iconp. 340
Loading Files with a File List Boxp. 342
Creating Special Graphic Effectsp. 345
18 Writing Reusable Code with Subs and Functionsp. 347
Using Procedures in Visual Basicp. 348
Making and Calling a Simple Subp. 348
Making Subs by Using Add Procedurep. 349
Making a Simple Functionp. 351
Passing Arguments into Subs and Functionsp. 352
Exiting Subs and Functionsp. 355
Understanding Scopep. 358
Documenting Subs and Functionsp. 359
Determining Your Entry Point with Sub Mainp. 361
19 Saving and Retrieving Your Data with Visual Basicp. 365
Understanding Persistencep. 366
Working with Files to Store and Retrieve Datap. 366
Saving Data with the Open Statementp. 367
Retrieving Data with Input Statementsp. 371
Manipulating Graphics with LoadPicture and SavePicturep. 373
Saving and Retrieving Data with the Visual Basic Registry Functionsp. 375
Using File System Objectsp. 379
20 Deploying Your Visual Basic Applicationsp. 385
Working with Version Informationp. 386
Compiling Your Projectp. 389
Using the Package and Deployment Wizardp. 391
IV Advanced Programming with Visual Basicp. 6
21 Debugging Your Applicationsp. 401
Catching Undeclared Variables with Option Explicitp. 402
Checking Code Segments with Breakpointsp. 404
Using Advanced Debugging Toolsp. 410
Using Find and Replacep. 413
Designing Applications for Debuggingp. 415
Creating an Error Handlerp. 417
22 Creating Controls On-the-Fly Using Control Arraysp. 421
What Is a Control Array?p. 422
Working with a Common Event Handlerp. 426
Grouping Objects with the Frame Controlp. 428
Using the Scroll Bar Controlsp. 429
Using For...Next Loops with Control Arraysp. 432
23 Programming Beyond Visual Basic Using the Windows APIp. 437
Understanding the Windows APIp. 438
Working with the API Viewerp. 440
Monitoring Mouse Movement with GetCursorPosp. 445
Keeping a Window Always on Top by Using SetWindowPosp. 447
Dragging a Window by Using SendMessagep. 452
Enhancing a List Box with SendMessagep. 454
Providing Help for Your Programsp. 458
Using the Help Workshopp. 458
24 Adding Help to Your Programsp. 457
Making a Help Filep. 462
Adding Help Files to Your Applicationp. 468
Making Context-Sensitive Helpp. 469
25 Using VBA to Connect Your VB Programs with Microsoft Officep. 475
Working with VBAp. 476
Using VBA with Microsoft Officep. 477
Making a Spelling Checker with VB and Wordp. 486
Making a Word Search Programp. 491
Working with Visual Basic, Access, and Excelp. 498
26 Making Object-Oriented Programs with Visual Basicp. 509
Understanding User-Defined Typesp. 510
Making Objects from Classesp. 512
Making an ActiveX DLLp. 521
Working with Componentsp. 527
27 Creating Your Own ActiveX Controls with Visual Basicp. 529
Creating an ActiveX Controlp. 530
Adding Functionality to an ActiveX Controlp. 535
28 Creating VB Programs for the Internetp. 543
Working on the Internetp. 544
Making a Simple Program with VBScriptp. 546
Using VBScript with Internet Explorerp. 548
Understanding a DHTML Applicationp. 565
29 Making Programming Easier with Visual Basic Add-Insp. 579
Working with Add-Insp. 580
Using Add-Insp. 582
Creating a Custom Add-Inp. 593
V Database Programming with Visual Basicp. 6
30 Database Basics and the Data Controlp. 605
Understanding Databasesp. 606
Working with the Intrinsic Data Controlp. 609
Creating Database-Bound Forms with the Data Form Wizardp. 614
31 Making Reports in Visual Basic 6p. 621
What's New with Reporting?p. 622
Building a Simple Reportp. 623
32 Enhancing Your Programs Using the Advanced Data Controlsp. 631
What Are Advanced Data Controls?p. 632
Adding and Configuring the ADO Data Controlp. 632
Using the DataGrid Controlp. 636
Using the DataList Controlp. 641
Using the DataCombo Controlp. 643
Working with the Data Form Wizardp. 644
Appendix Ap. 647
Appendix Bp. 701
Glossaryp. 781
Indexp. 799