Microsoft Press, 2010. — 544 p.
Getting Started with Microsoft Visual Basic 2010Exploring the Visual Studio Integrated Development EnvironmentThe Visual Studio Development Environment
The Visual Studio Tools
The Designer
Running a Visual Basic Program
The Properties Window
Moving and Resizing the Programming Tools
Moving and Resizing Tool Windows
Docking Tool Windows
Hiding Tool Windows
Switching Among Open Files and Tools by Using the IDE Navigator
Opening a Web Browser Within Visual Studio
Getting Help
Managing Help Settings
Using F1 Help
Customizing IDE Settings to Match
Step-by-Step Exercises
Setting the IDE for Visual Basic Development
Checking Project and Compiler Settings
One Step Further: Exiting Visual Studio
Quick Reference
Writing Your First ProgramLucky Seven: Your First
Visual Basic Program
Programming Steps
Creating the User Interface
Setting the Properties
The Picture Box Properties
Writing the Code
A Look at the Button1_Click
Procedure
Running Visual Basic Applications
Sample Projects on Disk
Building an Executable File
Deploying Your Application
One Step Further: Adding to a Program
Quick Reference
Working with Toolbox ControlsThe Basic Use of Controls: The Hello
World Program
Using the DateTimePicker Control
The Birthday Program
Controls for Gathering Input
Using Group Boxes and Radio Buttons
Processing Input with List Boxes
A Word About Terminology
One Step Further: Using the LinkLabel Control
Quick Reference
Working with Menus, Toolbars, and Dialog BoxesAdding Menus by Using the MenuStrip Control
Adding Access Keys to Menu Commands
Processing Menu Choices
Adding Toolbars with the ToolStrip Control
Using Dialog Box Controls
Event Procedures That Manage Common
Dialog Boxes
One Step Further: Assigning Shortcut Keys to Menus
Quick Reference
Programming FundamentalsVisual Basic Variables and Formulas, and the .NET FrameworkThe Anatomy of a Visual Basic Program Statement
Using Variables to Store Information
Setting Aside Space for Variables: The Dim Statement
Implicit Variable Declaration
Using Variables in a Program
Using a Variable to Store Input
Using a Variable for Output
Working with Specific Data Types
Constants: Variables That Don’t Change
Working with Visual Basic Operators
Basic Math: The +, –, *, and / Operators
Using Advanced Operators: \, Mod, ^, and &
Working with Math Methods in the .NET Framework
One Step Further: Establishing Order of Precedence
Using Parentheses in a Formula
Quick Reference
Using Decision StructuresEvent-Driven Programming
Using Conditional Expressions
If...Then Decision Structures
Testing Several Conditions in an If...Then
Decision Structure
Using Logical Operators in Conditional Expressions
Short-Circuiting by Using AndAlso and OrElse
Select Case Decision Structures
Using Comparison Operators with a Select
Case Structure
One Step Further: Detecting Mouse Events
Quick Reference
Using Loops and TimersWriting For...Next Loops
Using a Counter Variable in a Multiline TextBox Control
Creating Complex For...Next Loops
Using a Counter That Has Greater Scope
Writing Do Loops
Avoiding an Endless Loop
The Timer Control
Creating a Digital Clock by Using a Timer Control
Using a Timer Object to Set a Time Limit
One Step Further: Inserting Code Snippets
Quick Reference
Debugging Visual Basic ProgramsFinding and Correcting Errors
Three Types of Errors
Identifying Logic Errors
Debugging 101: Using Debugging Mode
Tracking Variables by Using a Watch Window
Visualizers: Debugging Tools That Display Data
Using the Immediate and Command Windows
Switching to the Command Window
One Step Further: Removing Breakpoints
Quick Reference
Trapping Errors by Using Structured Error HandlingProcessing Errors by Using the Try...Catch Statement
When to Use Error Handlers
Setting the Trap: The Try...Catch Code Block
Path and Disc Drive Errors
Writing a Disc Drive Error Handler
Using the Finally Clause to Perform Cleanup Tasks
More Complex Try...Catch Error Handlers
The Exception Object
Specifying a Retry Period
Using Nested Try...Catch Blocks
Comparing Error Handlers with Defensive
Programming Techniques
One Step Further: The Exit Try Statement
Quick Reference
Creating Modules and ProceduresWorking with Modules
Creating a Module
Working with Public Variables
Creating Procedures
Writing Function Procedures
Function Syntax
Calling a Function Procedure
Using a Function to Perform a Calculation
Writing Sub Procedures
Sub Procedure Syntax
Calling a Sub Procedure
Using a Sub Procedure to Manage Input
One Step Further: Passing Arguments by Value and by Reference
Quick Reference
Using Arrays to Manage Numeric and String DataWorking with Arrays of Variables
Creating an Array
Declaring a Fixed-Size Array
Setting Aside Memory
Working with Array Elements
Declaring an Array and Assigning It Initial Values
Creating a Fixed-Size Array to Hold Temperatures
Creating a Dynamic Array
Preserving Array Contents by Using ReDim Preserve
Using ReDim for Three-Dimensional Arrays
One Step Further: Processing Large Arrays by Using Methods in the Array Class
The Array Class
Quick Reference
Working with CollectionsWorking with Object Collections
Referencing Objects in a Collection
Writing For Each...Next Loops
Experimenting with Objects in the Controls Collection
Using the Name Property in a For Each...Next Loop
Creating Your Own Collections
Declaring New Collections
One Step Further: VBA Collections
Entering the Word Macro
Quick Reference
Exploring Text Files and String ProcessingReading Text Files
The My Namespace
The StreamReader Class
Using the ReadAllText Method
Writing Text Files
The WriteAllText Method
The StreamWriter Class
Using the WriteAllText Method
Processing Strings with the String Class
Sorting Text
Working with ASCII Codes
Sorting Strings in a Text Box
Examining the Sort Text Program Code
Protecting Text with Basic Encryption
One Step Further: Using the Xor Operator
Examining the Encryption Program Code
Quick Reference
Designing the User InterfaceManaging Windows Forms and Controls at Run TimeAdding New Forms to a Program
How Forms Are Used
Working with Multiple Forms
Using the DialogResult Property in the Calling Form
Positioning Forms on the Windows Desktop
Minimizing, Maximizing, and Restoring Windows
Adding Controls to a Form at Run Time
Organizing Controls on a Form
One Step Further: Specifying the Startup Object
Quick Reference
Adding Graphics and Animation EffectsAdding Artwork by Using the System.Drawing Namespace
Using a Form’s Coordinate System
The System.Drawing.Graphics Class
Using the Form’s Paint Event
Adding Animation to Your Programs
Moving Objects on the Form
The Location Property
Creating Animation by Using a Timer Object
Expanding and Shrinking Objects While a Program Is Running
One Step Further: Changing Form Transparency
Quick Reference
Inheriting Forms and Creating Base ClassesInheriting a Form by Using the Inheritance Picker
Creating Your Own Base Classes
Adding a New Class to Your Project
One Step Further: Inheriting a Base Class
Quick Reference
Working with PrintersUsing the PrintDocument Class
Printing Text from a Text Box Object
Printing Multipage Text Files
One Step Further: Adding Print Preview and Page Setup Dialog Boxes
Quick Reference
Database and Web ProgrammingGetting Started with ADO.NETDatabase Programming with ADO.NET
Database Terminology
Working with an Access Database
The Data Sources Window
Using Bound Controls to Display
Database Information
One Step Further: SQL Statements, LINQ, and Filtering Data
Quick Reference
Data Presentation Using the DataGridView ControlUsing DataGridView to Display Database Records
Formatting DataGridView Cells
Adding a Second Data Grid View Object
One Step Further: Updating the Original Database
Quick Reference
Creating Web Sites and Web Pages by Using VisualWeb Developer and ASP.NET
Inside ASP.NET
Web Pages vs. Windows Forms
Server Controls
HTML Controls
Building a Web Site by Using Visual
Web Developer
Considering Software Requirements for ASP.NET Programming
Using the Web Page Designer
Adding Server Controls to a Web Site
Writing Event Procedures for Web Page Controls
Customizing the Web Site Template
Displaying Database Records on a Web Page
One Step Further: Setting Web Site Titles in Internet Explorer
Quick Reference
Appendix: Where to Go for More Information