Click Here!
home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

Peter Norton's Guide to Visual Basic 6
(Publisher: Macmillan Computer Publishing)
Author(s): Peter Norton
ISBN: 0672310546
Publication Date: 09/09/98

Bookmark It

Search this book:
 
Introduction
What's on the CD-ROM
About the Authors

Part I—Using Visual Basic 6
Chapter 1—Getting Started with Visual Basic 6
Visual Basic: The Fast Track to Windows Development
Improving Technology for Developers
Understanding the Advantages of Visual Basic
Getting Help
Visual Basic Development Overview
Designing and Building the User Interface
Writing Code That Responds to Events
Creating and Calling Other Procedures as Needed
Testing and Debugging
Converting to Runtime Version
Preparing a Distributable Set of Files
Creating Your First Visual Basic Program
A Simple Project
Creating the Project
Adding Controls to the Form
Setting Control Properties
Writing Event-Driven Code
Testing and Debugging the Sample Application
Converting Sample Application to Runtime
Summary
Chapter 2—Understanding Visual Basic Projects
Using Different Types of Projects
Choosing a Project
Understanding the Different Components of a Project
Understanding the Project Explorer Window
Working with Multiple Projects
Setting Project Options
Using the General Page
Using the Make Page
Using the Compile Page
Summary
Chapter 3—Visual Basic Code Basics
Understanding Visual Basic Procedures
Understanding Subroutines
Understanding Functions
Understanding Comments
Using the Visual Basic Editor
Opening the Code Window
Understanding Code Window Features
Using Keyboard and Mouse Shortcuts in the Editor Window
Understanding Editor Options
Controlling Program Flow
Using Conditional Branching
Loops
Using Compiler Directives
Summary
Chapter 4—Using Visual Basic Variables
Taking a Look at an Example
Understanding Visual Basic Data Types
Byte
Integer
Long
Single
Double
Currency
Boolean
Date
String
Object
Variant
Declaring Variables
Comparing Implicit and Explicit Variable Performance
Providing Names for Your Variables
Forcing Explicit Declaration
Using a Naming Convention
Understanding Variable Scope and Lifetime
Examining Scope
Determining a Variable’s Lifetime
Converting Between Data Types
Working with Arrays
Declaring Arrays
Array Limitations
Understanding the Variant Data Type
Variant Storage Requirements
Special Values of Variant Variables
Passing Variables to Procedures
Optional Arguments
Using Named Arguments
Using Constants
User-Defined Data Types
Summary
Chapter 5—Designing the User Interface
Understanding the Visual Basic Form
Getting the Look and Feel of Windows
Creating Your First Form
Adding New Forms
Understanding Form Properties
Form Appearance Properties
BorderStyle
Name
Caption
Icon
Picture
BackColor
Font Properties
Form Control Properties
ControlBox
MinButton and MaxButton
Form Size and Positioning Properties
StartupPosition
Left, Top, Height, and Width
Movable
WindowState
ShowInTaskbar
More Form Properties
Other Form Properties
Tag
ScaleMode, ScaleTop, ScaleLeft, ScaleWidth, ScaleHeight
Referencing Form Properties
Setting Properties in Code
Positioning the Form with Methods
Move
ZOrder
Using Form Drawing Methods
Circle
Line
PSet
Point
Cls
Refresh
TextWidth, TextHeight
SetFocus
Showing and Hiding Forms
Loading Forms
Unloading Forms
Understanding Form Events
Form Maintenance Events
Initialize
Load
Activate, Deactivate
QueryUnload, Unload
Terminate
Form Operation Events
GotFocus, LostFocus
Paint
Resize
Form Mouse Events
Click, DblClick
MouseDown, MouseUp
MouseMove
Form Keyboard Events
KeyDown, KeyUp
KeyPress
Making the Most of Built-In Dialog Boxes
The Message Box
Using the InputBox Function
Understanding MDI Applications
Creating an MDI Parent Form
Turning Forms Into MDI Child Forms
Behavior of MDI Child Forms
Making the MDI Parent the Startup Form
Creating Multiple Instances of Forms
Wrapping Up Forms
Summary
Chapter 6—Putting Your Forms to Work with Controls
Getting to Know the Toolbox
Getting to Know the Visual Basic Tools
Customizing the Toolbox
Adding Controls to Forms
Using the Alignment Grid
Multiselecting Controls
Form Layout Functions
Control Properties
Displaying Simple Text
Displaying a Button
Displaying a List
Displaying a Drop-Down Selection List
Displaying a Check Box
Providing Mutually Exclusive Options
Using the Frame Control
Entering Text
Drawing Shapes and Displaying Pictures
Selecting Files, Colors, Fonts, Printers, and Help
Generating Timed Events
OLE Container Control
Grid and Spreadsheet Controls
Creating Tabbed Displays
Other Controls
Naming Controls
Copying Controls
Control Arrays
Referencing Controls
Passing a Control as an Argument
Determining the Type of Control
Using the Controls Collection
Control Focus
Setting Tab Order
Binding Controls
Dragging and Dropping
Handling Keyboard Events
Handling Mouse Events
Summary
Chapter 7—Mastering Menus and Toolbars
Understanding Menus
Using the Menu Editor
Menu Arrays
Applying Menu Conventions
Using Ellipses
Allowing Keyboard Navigation
Using Shortcut Keys
Using Pop-Up Menus
Configuring Menus at Runtime
Understanding Toolbars
Finding the Perfect Icons
Adding Toolbars to Your Application
Customizing the Toolbar
Removing a Button
Changing a ToolTip
Changing an Icon
Adding a Button
Moving a Button
Creating Toggle-Style Buttons
Creating Option-Style Buttons
Adding Captions to Buttons
Configuring the Toolbar at Runtime
Handling Toolbar Events
Running the Menu and Toolbar Demo Program
Summary
Chapter 8—Using the Visual Basic Debugging Tools
Finding Errors
Identifying Syntax Errors
Identifying Logical Errors
Dealing with Runtime Errors
Avoiding Errors
Using the Module Options
Traditional Debugging Techniques
Using MsgBox
Using Debug.Print
Using the Visual Basic Debugging Tools
Using the Debug Toolbar
Suspending Execution with Breakpoints
Stepping Through Code
Controlling Program Flow
Getting to Know the Debugging Windows
Using the Call Stack
Summary
Chapter 9—Handling Runtime Errors
Recognizing Runtime Errors
Trapping Errors in Visual Basic Applications
Trapping the Error
Handling the Error
Redirecting the Program Flow
Using the Err Object
Using the Err.Description Property
Using the Err.Number Property
Displaying More Helpful Information
Knowing Which Errors to Trap
Using the Resume Statement
Resume Label
Resume Next
Resume
Using On Error GoTo 0
Handling Errors Locally
Logging Errors
Summary

Part II—Object-Oriented Programming
Chapter 10—Creating Objects and Classes
Understanding the Benefits of Object-Oriented Development
Understanding the Component Object Model (COM)
Getting Started with Objects
Examining Objects
Using Objects in Applications
Understanding Classes
Creating a Simple Class
Beginning the Class Module
Adding Properties to the Class
Creating Methods for the Class
Using the Class Module
Using Property Procedures
Understanding Property Procedure Types
Bulletproofing Property Procedures
Summary
Chapter 11—Advanced Class Concepts
Understanding Initialize and Terminate
Looking at Class_Initialize
Using Class_Terminate
Testing for Existing Class Objects
Creating Special Types of Properties
Creating a Read-Only Property
Setting Up Write-Only Properties
Setting Up a Default Property or Method
Enhancing the Simple Class
Looking at the Class_Initialize Procedure
Adding Simple Property Procedures
Adding the Color Property Procedures
Adding the Year Property Procedures
Adding Simple Methods to clsCar2
Enhancing the Decelerate Method
Enhancing the Accelerate Method
Using the Enhanced Object Class
Filling the Form with Data
Creating and Destroying the Car Object
Setting the Car’s Color
Making the Clean Check Box Read-Only
Using the Object Browser
Understanding Collections
Summary
Chapter 12—Working with Objects and Collections
Using Collections
Examining Built-In Visual Basic Collections
Looking at the Forms Collection
Understanding the Controls Collection
Surveying Other Built-In Collections
Using the Collection Object
Creating a Collection
Adding Objects to the Collection
Counting the Number of Items in the Collection
Retrieving Objects from the Collection
Removing Items from the Collection
Destroying the Collection
Optimizing Object References
Building the Case for Custom Collections
Understanding Wayward Objects
Encapsulating Functionality
Creating Custom Collections
Beginning the Collection Class
Adding the Item Method
Programming the Add Method
Implementing the Remove Method
Implementing the Paint Method
Programming the BlueCount Property
Wrapping Up the Collection Class
Summary

Part III—Creating Printed Output
Chapter 13—Using the Printer Object
Printing Information
Following a Simple Print Routine
Using the Printer Object’s Methods
Controlling the Printer
Using the Printer Collection
Summary
Chapter 14—Using Crystal Reports
Explaining Crystal Reports
Taking a Quick Tour
Using the Design Window
Using the Preview Window
Working with the Crystal Reports Wizards
Adding Custom Formulas to a Report
Selecting the Required Records
Creating a Report
Starting the Design Process
Selecting the Fields for the Report
Using the Crystal Reports Custom Control
Selecting the Report to Run
Modifying the Optional Properties
Activating the Custom Control
Changing the Properties at Runtime
Creating a Report Selection Interface
Summary

Part IV—Accessing Data
Chapter 15—Reading and Writing Text Files
Understanding Text Files
Downloading the Data
Reviewing Database Terminology
Looking at Text File Formats
Understanding Data Access Methods
Sequential File Access
Random File Access
Binary File Access
Opening Text Files
Reading Fixed-Width Text Files
Reading Delimited Text Files
Looking at More Complex Examples
Reading Complex Fixed-Width Files
Reading Complex Delimited Files
Taking a Closer Look at File Commands
Open
Line Input
Input
Creating Text Files
Outputting Fixed-Width Data to a File
Creating Delimited Text Files
Understanding Visual Basic’s String Functions
Looking at Other File Operations
Deleting Files
Listing the Contents of a Folder
Detecting the End of a File
Copying a File
Determining a File’s TimeStamp
Determining the Size of a Closed File
Determining the Size of an Open File
Getting a File’s Attributes
Setting a File’s Attributes
Summary
Chapter 16—Mastering the Visual Basic Data Control
Introducing the Data Control
Using the Data Control
Understanding the Data Control Properties
Knowing the Current Record
Using Data-Bound Controls
Manipulating the Data Control at Runtime
Programmed Access Using Events
Navigating the Data Control in Code
Summary
Chapter 17—Creating Queries in Visual Basic
Defining SQL
Using the SELECT Statement
Accessing Multiple Tables
Adding Calculated Fields
Specifying the Filter Criteria
Aggregating the Data
Grouping the Data
Using SQL Statements with the Data Control
Testing the SQL
Summary
Chapter 18—Mastering Jet DAO
Understanding How Jet Began
What Jet Does
Jet Tables
Jet Storage
Jet Indexes
Jet Relations
Jet Queries
Using Jet in the World of Database Applications
Understanding Relational Databases
Understanding Normalization
Understanding DDL and DML
Understanding DAO Collections, Classes, and Objects
Getting Started with Jet and DAO
Changing the Data Structure
Creating an Application
Starting the Application
Adding a Record
Saving the Record
Working with SQL
Working with the Data Bound Control
Displaying Related Records with a Data Grid
Summary
Chapter 19—Using Advanced Data Access Methods
Understanding OLE DB
Independently Created Objects
Different Cursor Types
Using the ADO Library
Looking into the ADO Object Model
Establishing ADO Connections
Using BeginTrans, CommitTrans, and RollbackTrans
Using the Error Object
Understanding the Basics of the ADO Recordset Object
Creating a Recordset
Adding a New Record
Creating Temporary Tables
Accessing Parameter Queries and Stored Procedures
Using the Parameter Object
Executing Parameter-Driven Stored Procedures
Multiple Resultset Stored Procedures
Summary

Part V—Integrating with Other Applications
Chapter 20—Integrating with Microsoft Office 97
Understanding ActiveX
Understanding Automation Concepts
Looking at a Short Example
Referencing the Automation Server
Understanding Object Models
Integrating with Word 97
Opening a Document in Word 97
Learning the Word Commands to Use
Displaying a Word Document in Print Preview
Creating a New Word Document
Saving a Word Document
Using Automation in Visual Basic Projects
Summary
Chapter 21—Integrating with Microsoft Outlook 97
Understanding the Outlook Object Model
Controlling Outlook
Understanding Outlook Folders
Creating an Outlook Instance
Making Outlook Visible
Creating a Mail Message in Outlook
Attaching an Object to a Mail Message
Sending the Message
Closing Outlook
Creating Outlook Items
Looking at Common Properties
Creating Outlook Contact Items
Adding Appointment Items
Creating Outlook Note Items
Creating a Journal Entry
Creating Outlook Task Items
Summary

Part VI—Developing for the Internet
Chapter 22—Integrating with Internet Explorer
Using Automation with Internet Explorer
Referencing the Internet Explorer Automation Server
Referencing an Internet Explorer Automation Object
Hiding and Showing Internet Explorer
Shutting Down Internet Explorer
Browsing a Specific Page or Document Using the Navigate Method
Navigating the History List
Displaying the User’s Home Page or Search Page
Using the Properties of the Internet Explorer Object
Using the WebBrowser Control
Understanding the WebBrowser Events
The BeforeNavigate2 Event
The CommandStateChange Event
The DownloadBegin Event
The DownloadComplete Event
The NavigateComplete2 Event
The NewWindow2 Event
The ProgressChange Event
The TitleChange Event
Summary
Chapter 23—Web Development with Visual Basic 6
Understanding Scripting Versus Components
Understanding the Difference Between ActiveX Controls and Visual Basic Documents
Creating an ActiveX Control for the Web
Creating the New Control
Adding the Code Behind the Form
Adding Properties and Methods to Your Web Control
Changing the Code Functionality
Deploying Your Web Control
Compiling Your Control
Creating the Setup for Your Control
Testing Your Control in a Web Page
Enabling a Control Through Script
Interacting with Your Control in a Web Page
Summary
Chapter 24—Creating Intranet Applications
Comparing Client-Side and Server-Side Scripting
Understanding Client-Side Scripting
Using ASP with Microsoft Web Servers
Creating an ASP Page
Glimpsing at Database Access with ADO
Creating the Default Application Screens
Listing the Records
Adding a Record
Editing an Existing Record
Deleting an Existing Record
Summary

Part VII—Advanced Topics
Chapter 25—Mastering the Windows API
Defining the Windows API
Understanding Dynamic Linking
Why Use the Windows API?
Accessing a Common Code Base
Using Tested and Proven Code
Gaining Cross-Platform Compatibility
Achieving a Smaller Application Footprint
Using DLL Documentation
Finding Documentation
Deciphering the Documentation
Understanding API Data Types
Moving from Windows 3.1 to Win32
Taking Advantage of Architectural Differences
Finding New Homes for API Functions
Learning New API Function Names
Accounting for Changes to API Calls
Using the Windows API
Understanding the Declare Statement
Understanding Windows Handles
Taking a Look at WinAPI.vbp
Getting Application Information
GetWindowTextA
SetWindowTextA
GetParent
GetCommandLineA
GetClassNameA
Getting Windows Information
GetWindowsDirectoryA
GetSystemDirectoryA
GetTempPath
GetVersionExA
GetUserNameA
Getting Hardware Information
GetComputerNameA
GetDriveTypeA
GetDiskFreeSpaceA
Getting Disk Volume Information with GetVolumeInformationA
Summary
Chapter 26—INI Files and the System Registry
Understanding the Registry
Using Regedit
Editing Registry Values
Adding New Registry Values
Programming the Registry
Using VBA Calls to Program the Registry
Using the Windows API to Program the Registry
Manipulating INI Files
WriteProfileString
GetProfileString
GetProfileInt
WritePrivateProfileString
GetPrivateProfileString
GetPrivateProfileInt
Summary
Chapter 27—Using the Package and Deployment Wizard
Using the Distribution Wizard
Working with the Wizard
Starting the Wizard
Deploying the Package
Floppy Disks
Folders
WebPost
Managing Scripts
Testing the Installation
Summary
Chapter 28—Professional Visual Basic Development
Understanding What Makes a Professional Application
Application Types
Picking the Right Application
Following the Project Life Cycle
Application Performance
Creating the Right Impression
Letting Windows Work
Distracting the User
Understanding an Application’s Components
Designing Good Forms
Using an About Box
Using the System Registry
Supporting the Users
Owning Your Program
Protecting Your Application Name
Copyrighting Your Work
Making the Final Decision
Summary
Appendix A
Appendix B
Index

Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited.