Books & Videos

Table of Contents

  1. Chapter 1 Visual Basic Programming

    1. Introduction

    2. Creating a Windows Forms Application

    3. Creating a Console Application

    4. Creating an ASP.NET Web Forms Application

  2. Chapter 2 The Development Environment

    1. Introduction

    2. Discovering and Using a Code Snippet

    3. Creating a New Snippet

    4. Sharing Snippets

    5. Adding Snippet Files to Visual Studio

    6. Getting an Application's Version Number

    7. Letting Visual Studio Automatically Update an Application's Version Number

    8. Setting the Startup Form for an Application

    9. Setting the Startup to a Sub Main Procedure

    10. Getting an Application's Command Line

    11. Testing an Application's Command Line

    12. Obfuscating an Application

    13. Determining if an Application Is Running in the Visual Studio Environment

    14. Accessing Environment Variables

    15. Accessing the Registry

    16. Getting System Information

    17. Getting the User's Name

  3. Chapter 3 Application Organization

    1. Introduction

    2. Creating a Code Module

    3. Creating a Class

    4. Creating a Structure

    5. Creating Other Item Types

    6. Creating Object Instances

    7. Initializing a Class Instance with Data

    8. Releasing an Instance's Resources

    9. Using Namespaces

    10. Splitting a Class Across Multiple Files

    11. Creating a Form Based on Another Form

    12. Passing and Returning Structures and Other Objects

    13. Creating and Using an Enumeration

    14. Converting Between Numeric and String Enumeration Values

    15. Creating a Method That Accepts Different Sets of Arguments

    16. Using Standard Operators for Nonstandard Purposes

    17. Enforcing Strong Data Typing in an Otherwise Weakly Typed Collection

  4. Chapter 4 Forms, Controls, and Other Useful Objects

    1. Introduction

    2. Creating and Adding Controls at Runtime

    3. Iterating Through All Controls on a Form

    4. Sharing Event-Handler Logic Among Many Controls

    5. Working with Timers

    6. Determining If a Control Can Take the Focus

    7. Programmatically Clicking a Button

    8. Drawing a Control

    9. Making a Form the Top-Most Form

    10. Indicating the Accept and Cancel Buttons on a Form

    11. Remembering a Form's Position Between Uses

    12. Attaching a Control to the Edge of a Form

    13. Moving or Resizing Controls as a Form Resizes

    14. Limiting the Sizing of a Form

    15. Centering a Form

    16. Creating and Moving a Borderless Form

    17. Creating a Fading Form

    18. Creating a Nonrectangular Form

    19. Changing Menus at Runtime

    20. Creating Shortcut Menus

  5. Chapter 5 Strings

    1. Introduction

    2. Using a StringBuilder

    3. Creating a String of N Identical Characters

    4. Creating a String by Repeating a String N Times

    5. Obfuscating a String

    6. Converting Binary Data to a Hexadecimal String

    7. Extracting Substrings from Larger Strings

    8. Converting a String's Case

    9. Comparing Strings with Case Sensitivity

    10. Comparing Strings Without Case Sensitivity

    11. Converting Strings to and from Character Arrays

    12. Converting Strings to and from Byte Arrays

    13. Tallying Characters

    14. Counting Words

    15. Removing Extra Whitespace

    16. Using the Correct End-of-Line Characters

    17. Replacing Substrings

    18. Inserting a Character or String

    19. Inserting a Line

    20. Double-Spacing a String

    21. Formatting Numbers into Strings

    22. Trimming Sets of Characters from a String

    23. Identifying and Validating Types of Data in a String

    24. Converting Strings Between Encoding Systems

    25. Determining a Character's Type

    26. Parsing Strings

    27. Concatenating Strings

    28. Speeding Up String Manipulation

    29. Counting Occurrences of a Substring

    30. Padding a String for Exact Length and Alignment

    31. Converting Tabs to Spaces

    32. Reversing a String

    33. Shuffling a String

    34. Using a Simple String Encryption

    35. Converting a String to Morse Code

    36. Adding Strings to an Application's Resources

    37. Converting Any Data to a String

    38. Using Regular Expressions to Extract All Numbers

    39. Getting a Count of Regular Expression Matches

    40. Getting the Nth Regular Expression Match

    41. Compiling Regular Expressions for Speed

    42. Using Regular Expressions to Validate Data

    43. Using Regular Expressions to Count Characters, Words, or Lines

    44. Converting a String to and from Base64

    45. Splitting a String

    46. Creating a String of Space Characters

  6. Chapter 6 Numbers and Math

    1. Introduction

    2. Using Compact Operator Notation

    3. Choosing Integers of the Right Size and Type for the Job

    4. Using Unsigned Integers

    5. Swapping Two Integers Without Using a Third

    6. Using Single- and Double-Precision Variables

    7. Using Decimal Variables for Maximum Precision

    8. Converting Between Number Types

    9. Rounding Numbers Accurately

    10. Declaring Loop Counters Within Loops

    11. Converting Between Radians and Degrees

    12. Limiting Angles to a Range

    13. Creating Double-Precision Point Variables

    14. Converting Between Rectangular and Polar Coordinates

    15. Creating Three-Dimensional Variables

    16. Converting Between Rectangular, Spherical, and Cylindrical Coordinates

    17. Working with Complex Numbers

    18. Solving Right Triangles

    19. Solving Any Triangle

    20. Determining if a String Contains a Valid Number

    21. Converting Numbers to Integers

    22. Calculating π to Thousands of Digits

    23. Getting a Number's Prime Factors

    24. Using Recursion to Calculate Factorials

    25. Manipulating Bits with Bitwise Operators

    26. Storing and Retrieving Bits in a BitArray

    27. Enhancing the Random Number Generator

    28. Generating Random Integers in a Range

    29. Generating Random Real Numbers in a Range

    30. Generating Normal-Distribution Random Numbers

    31. Generating Exponential-Distribution Random Numbers

    32. Creating a Matrix

    33. Inverting a Matrix

    34. Calculating the Determinant of a Matrix

    35. Solving Simultaneous Equations

    36. Listing of the MatrixHelper Class

  7. Chapter 7 Dates and Times

    1. Introduction

    2. Getting the System Date and Time

    3. Accessing the System's Time Zone

    4. Using System Ticks

    5. Timing Application Activities

    6. Calculating Elapsed Time Using Ticks

    7. Calculating Elapsed Time with the Stopwatch

    8. Extracting Year, Month, and Day Numbers from a Date Value

    9. Extracting Hour, Minute, and Second Numbers from a Date Value

    10. Creating a Date or Time Value from Its Parts

    11. Formatting Dates and Times

    12. Parsing and Validating Dates and Times

    13. Adding to Dates and Times

    14. Subtracting from Dates and Times

    15. Determining the Number of Days Between Two Dates

    16. Determining the Day of the Week for a Date

    17. Determining the Day of the Year for a Date

    18. Determining the Number of Days in a Month

    19. Using Controls to Enter or Select a Date

    20. Calculating the Phase of the Moon

    21. Creating a Calendar

    22. Checking for Leap Years

    23. Dates and Times in ISO 8601 Formats

  8. Chapter 8 Arrays and Collections

    1. Introduction

    2. Filling an Array While Declaring It

    3. Sorting Array Elements

    4. Reversing an Array

    5. Inserting into an Array

    6. Shuffling an Array

    7. Swapping Two Array Values

    8. Resizing Arrays Without Losing Existing Values

    9. Quickly Copying Part of an Array into Another

    10. Writing a Comma-Separated-Values File from a String Array

    11. Reading a Comma-Separated-Values File into a String Array

    12. Using a Multivalue Array Instead of a Two-Dimensional Array

    13. Converting Between Delimited Strings and Arrays

    14. Formatting an Array as a Single String

    15. Iterating Through Array Elements

    16. Passing Arrays to Methods

    17. Returning Arrays from Functions

    18. Creating a Collection

    19. Inserting an Item into a Collection

    20. Deleting a Collection Item

    21. Iterating Through a Collection

  9. Chapter 9 Graphics

    1. Introduction

    2. Creating Graphics Objects

    3. Drawing on Controls for Special Effects

    4. Letting the User Select a Color

    5. Working with Coordinate Systems (Pixels, Inches, Centimeters)

    6. Creating a Bitmap

    7. Setting a Background Color

    8. Drawing Lines, Ellipses, and Rectangles

    9. Drawing Lines One Pixel Wide Regardless of Scaling

    10. Forcing a Form or Control to Redraw

    11. Using Transparency

    12. Scaling with Transforms

    13. Using an Outline Path

    14. Using Gradients for Smooth Color Changes

    15. Drawing Bezier Splines

    16. Drawing Cardinal Splines

    17. Limiting Display Updates to Specific Regions

    18. Drawing Text

    19. Rotating Text to Any Angle

    20. Mirroring Text on the Canvas

    21. Getting the Height and Width of a Graphic String

    22. Drawing Text with Outlines and Drop Shadows

    23. Calculating a Nice Axis

    24. Drawing a Simple Chart

    25. Creating Odd-Shaped Forms and Controls

    26. Using the RGB, HSB (HSV), and HSL Color Schemes

    27. Creating a Rubber-Band Rectangular Selection

    28. Animating with Transparency

    29. Substitutions for Obsolete Visual Basic 6.0 Features

  10. Chapter 10 Multimedia

    1. Introduction

    2. Playing an Audio File

    3. Displaying Image Files

    4. Playing a Video File

    5. Making Your Computer Beep

    6. Creating an Animation Using Multiple Images

    7. Creating an Animation by Generating Multiple Bitmaps

    8. Creating an Animation by Drawing at Runtime

    9. Creating Animated Sprites

    10. Resizing and Compressing JPEG Files

    11. Getting JPEG Extended Information

    12. Creating Thumbnails

    13. Displaying Images While Controlling Stretching and Sizing

    14. Scrolling Images

    15. Merging Two or More Images

    16. Using Resource Images

    17. Capturing an Image of the Screen

    18. Getting Display Dimensions

    19. Speeding Up Image Processing

    20. Converting an Image to Grayscale

    21. Performing Edge Detection on an Image

    22. Full Listing of the LockImage Class

  11. Chapter 11 Printing

    1. Introduction

    2. Enumerating Printers

    3. Sending "Raw" Data to a Printer

    4. Get Details About the Default Printer

    5. Creating a Print Preview

    6. Prompting for Printed Page Settings

    7. Drawing Text and Graphics to a Printer

    8. Determining the Print Destination

    9. Creating Graph Paper

  12. Chapter 12 Files and File Systems

    1. Introduction

    2. Enumerating Drives

    3. Determining if a Directory Exists

    4. Creating a New Directory

    5. Copying Directories

    6. Moving Directories

    7. Renaming Directories

    8. Parsing File and Directory Paths

    9. Searching Iteratively Through Directories and Subdirectories

    10. Finding Directories and Files Using Wildcards

    11. Determining If a File Exists

    12. Getting and Setting File Attributes

    13. Accessing Special User and Windows Directories

    14. Determining the Space on a Drive

    15. Browsing for a Directory

    16. Getting File Information

    17. Using File-Access Methods

    18. Reading and Writing Files as Strings

    19. Reading and Writing Binary Files

    20. Copying or Moving a File

    21. Sending a File to the Recycle Bin

    22. Creating a Temporary File

    23. Calculating a Checksum for a File

    24. Comparing Two Files for Equality

    25. Locking a File During Access

    26. Reading from a File at a Specific Position

    27. Reading and Writing Objects in a File

    28. Creating a Comma-Separated-Values File

  13. Chapter 13 Databases

    1. Introduction

    2. Connecting to a Data Provider

    3. Issuing SQL Commands

    4. Retrieving Results from a Database Query

    5. Using SQL Parameters

    6. Using Stored Procedures

    7. Using Transactions

    8. Storing the Results of a Query in Memory

    9. Creating In-Memory Data Tables Manually

    10. Writing In-Memory Data Tables to an XML File

    11. Reading an XML File into In-Memory Data Tables

  14. Chapter 14 Special Programming Techniques

    1. Introduction

    2. Preventing Multiple Instances of a Running Application

    3. Creating a Simple User Control

    4. Describing User Control Properties

    5. Starting Other Applications by EXE, Document, or URL

    6. Waiting for Applications to Finish

    7. List All Running Processes

    8. Terminating a Running Process

    9. Pausing Execution of a Program

    10. Control Applications by Simulating Keystrokes

    11. Watching for File and Directory Changes

    12. Creating an Icon in the System Tray

    13. Accessing the Clipboard

    14. Adding Tooltips to Controls

    15. Dragging and Dropping Files to a ListBox

    16. Dragging and Dropping Between ListBox Controls

    17. Disposing of Objects Appropriately

    18. Fine-Tuning Garbage Collection

    19. Moving the (Mouse) Cursor

    20. Intercepting All Key Presses on a Form

    21. Accessing the Registry

    22. Running Procedures in Threads

    23. Reading XML into a TreeView

    24. Creating an XML Document

    25. Validating an XML Document

    26. Using Generic Collections

    27. Creating a Screensaver

    28. Localizing the Controls on a Form

    29. Adding Pop-up Help to Controls

    30. Maintaining User-Specific Settings Between Uses of an Application

    31. Verifying a Credit Card Number

    32. Capturing a Console Application's Output

    33. Reading an Assembly's Details

    34. Performing Serial I/O

    35. Rebooting the System

  15. Chapter 15 Exceptions

    1. Introduction

    2. Catching an Exception

    3. Throwing an Exception

    4. Catching Unhandled Exceptions

    5. Displaying Exception Information

    6. Creating New Exception Types

    7. Ignoring Exceptions in a Block of Code

  16. Chapter 16 Cryptography and Compression

    1. Introduction

    2. Generating a Hash

    3. Encrypting and Decrypting a String

    4. Encrypting and Decrypting a File

    5. Prompting for a Username and Password

    6. Handling Passwords Securely

    7. Compressing and Decompressing a String

    8. Compressing and Decompressing a File

    9. Generating Cryptographically Secure Random Numbers

    10. Complete Listing of the Crypto.vb Module

    11. Complete Listing of the Compress.vb Module

  17. Chapter 17 Web Development

    1. Introduction

    2. Displaying Web Pages on a Form

    3. Accessing Content Within an HTML Document

    4. Getting All Links from a Web Page

    5. Get the Local Computer's IP Address

    6. Resolving a Host Name or IP Address for Another Computer

    7. Pinging an IP Address

    8. Using FTP to Download Files

    9. Calling a Web Service

    10. Sending Email Using SMTP

    11. Getting POP3 Emails

    12. Sending a Message to Another Computer

    13. Adding Hyperlinks to a (Desktop) Form

  1. Colophon