RTM’d today: Microsoft Visual Basic 2010 Step by Step

626690.indd Another book updated for Visual Studio 2010, Microsoft Visual Basic 2010 Step by Step , by Michael Halvorson, has shipped to the printer!

The title will be available via online retailers later this month.  When it is, we’ll post longer excerpts.  In the meantime, here’s a bit of information about the book:

Contents at a Glance

Part I   Getting Started with Microsoft Visual Basic 2010

1   Exploring the Visual Studio Integrated Development
Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2   Writing Your First Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3   Working with Toolbox Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
4   Working with Menus, Toolbars, and Dialog Boxes . . . . . . . . . . . 97

Part II   Programming Fundamentals

5   Visual Basic Variables and Formulas,
and the .NET Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
6   Using Decision Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
7   Using Loops and Timers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
8   Debugging Visual Basic Programs . . . . . . . . . . . . . . . . . . . . . . . . 209
9   Trapping Errors by Using Structured Error Handling. . . . . . . . . 227
10   Creating Modules and Procedures . . . . . . . . . . . . . . . . . . . . . . . . 247
11   Using Arrays to Manage Numeric and String Data . . . . . . . . . . 273
12   Working with Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
13   Exploring Text Files and String Processing . . . . . . . . . . . . . . . . . 313

Part III   Designing the User Interface

14   Managing Windows Forms and Controls at Run Time . . . . . . . 351
15   Adding Graphics and Animation Effects . . . . . . . . . . . . . . . . . . . 375
16   Inheriting Forms and Creating Base Classes . . . . . . . . . . . . . . . . 393
17   Working with Printers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415

Part IV   Database and Web Programming

18   Getting Started with ADO.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
19   Data Presentation Using the DataGridView Control . . . . . . . . . 467
20   Creating Web Sites and Web Pages by Using Visual
Web Developer and ASP.NET . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491

Introduction

Microsoft Visual Basic 2010 is an important upgrade and enhancement of the popular Visual
Basic programming language and compiler, a technology that enjoys an installed base of
millions of programmers worldwide. Visual Basic 2010 is not a stand-alone product but
a key component of Microsoft Visual Studio 2010—a comprehensive development system
that allows you to create powerful applications for Windows, the Web, handheld devices,
and a host of other environments. Whether you purchase one of the commercial editions of
Visual Studio 2010 (described later in this Introduction) or you download Visual Basic 2010
Express for a free test-drive of the software, you are in for an exciting experience. The latest
features of Visual Basic will increase your productivity and programming prowess, especially
if you enjoy using and integrating information from databases, entertainment media, Web
pages, and Web sites. In addition, an important benefit of learning Visual Basic and the Visual
Studio Integrated Development Environment (IDE) is that you can use many of the same
tools to write programs for Microsoft Visual C++ 2010, Microsoft Visual C# 2010, Microsoft
Visual Web Developer 2010, and other popular products.

Microsoft Visual Basic 2010 Step by Step is a comprehensive introduction to Visual Basic
programming using the Visual Basic 2010 software. I’ve designed this practical, hands-on
tutorial with a variety of skill levels in mind and by following the premise that programmers
learn by doing. In my opinion, the best way to master a complex technology like Visual Basic
is to learn essential programming techniques through carefully prepared tutorials that can
be completed on your own schedule and at your own pace. And although I have significant
experience with college teaching and corporate project management, this book is not
a dry textbook or an “A to Z” programmer’s reference. Instead, it is a practical hands-on
programming tutorial that puts you in charge of your learning, developmental milestones,
and achievements. By using this book, programmers who are new to this topic will learn
Visual Basic software development fundamentals in the context of useful, real-world
applications; and experienced Visual Basic programmers can quickly master the essential
tools and techniques offered in the Visual Basic 2010 upgrade.

Complementing this comprehensive approach is the book’s structure—4 topically organized
parts, 20 chapters, and 56 step-by-step exercises and sample programs. By using this book,
you’ll quickly learn how to create professional-quality Visual Basic 2010 applications for the
Windows operating system and a variety of Web browsers. You’ll also have fun!

Visual Basic Versions

So how did we get here, anyway? Between 1991 and 1998, Microsoft released six versions
of Visual Basic (versions 1.0 through 6.0), which revolutionized software development for
Windows by introducing event-driven programming to a wide audience based on the
QuickBasic programming language and an IDE. After a significant period of additional
development and innovation, Microsoft released Visual Basic .NET 2002, an object-oriented
programming language closely related to Visual Basic but implemented on the Microsoft
.NET Framework, a comprehensive library of coded solutions intended to be used by most
new applications that run on the Windows platform. As improved versions of Visual Basic
came out in 2003, 2005, and 2008, Visual Basic became a component within the Visual
Studio suite, and signifi cant support was added to the product for database, Internet,
and team development projects, as well as continued improvements to the .NET Framework.
Visual Basic 2010 is now so tightly integrated with Visual Studio that it is available only
as a component in the Visual Studio 2010 programming suite, which includes Visual C#,
Visual C++, Visual Web Developer, and other Microsoft .NET development tools. Since
2005, both Visual Basic and Visual Studio have been marketed without the “.NET” moniker,
although they are still based on the .NET Framework technology.

Visual Studio 2010 is distributed in several different product configurations, including
Professional, Premium, Ultimate, and Express. I’ve written this book to be compatible
with all editions of Visual Basic 2010 and Visual Studio 2010, but especially with the tools
and techniques available in Visual Studio 2010 Professional and Visual Basic 2010 Express.
Although Visual Basic 2010 is similar in many ways to Visual Basic 2008, there are many
important differences and improvements, so I recommend that you complete the exercises
in this book using the Visual Basic 2010 software.

Note   The Visual Studio 2010 software is not included with this book. The CD distributed with
most versions of this book contains practice fi les, sample databases, and other useful information
that requires the Visual Studio 2010 software (sold separately) for use. If you don’t have Visual
Studio, you can download Visual Basic 2010 Express for free, and it contains an amazing palette
of features, though obviously not all the features of Visual Studio Professional, Premium, or
Ultimate. As you complete the exercises in this book, I will note from time to time which features
are unavailable to you if you are using Visual Basic 2010 Express. Also note that if you are using
Visual Basic 2010 Express and you want to complete Chapter 20, “Creating Web Sites and Web
Pages by Using Visual Web Developer and ASP.NET,” you will need to download Visual Web
Developer 2010 Express to complete the exercises. Visual Web Developer is included in Visual
Studio Professional, Premium, and Ultimate, but not Visual Basic Express.

Downloading Visual Basic 2010 Express

As noted previously, if you don’t have Visual Studio 2010 Professional, Visual Studio 2010
Premium, or Visual Studio 2010 Ultimate, you can complete most of the exercises in this
book by downloading Visual Basic 2010 Express from the Web for free. This will give you
an opportunity to learn Visual Basic programming and see for yourself if you want to
upgrade to a full release of the Visual Studio software.

To download Visual Basic 2010 Express, complete the following steps:

1. Open a Web browser (such as Internet Explorer), and go to https://www.microsoft.com/express.
2. Follow the instructions on the screen to download Visual Basic 2010 Express.

On the Express Web site, you will also see an Express product feature chart that compares
the Express product to the full versions of Visual Studio. Although there are some key
differences between the full versions and Visual Basic 2010 Express, many of these
differences have no effect on how you learn the essential techniques and features of
Visual Basic programming. After you experiment with the Express product, you can decide
whether you want to upgrade to one of the full versions of Visual Studio or not. Now, let’s
get started learning about Visual Basic and how this programming course works!