Synopses & Reviews
Your hands-on, step-by-step guide to learning Visual Basic® 2010.
Teach yourself the essential tools and techniques for Visual Basic® 2010-one step at a time. No matter what your skill level, you'll find the practical guidance and examples you need to start building professional applications for Windows® and the Web.
Discover how to:
Work in the Microsoft® Visual Studio® 2010 Integrated Development Environment (IDE) Master essential techniques-from managing data and variables to using inheritance and dialog boxes Create professional-looking UIs; add visual effects and print support Build compelling Web features with the Visual Web Developer tool Use Microsoft® ADO.NET and advanced data presentation controls Debug your programs and handle run-time errors Use new features, such as Query Builder, and Microsoft® .NET Framework A Note Regarding the CD or DVD
The print version of this book ships with a CD or DVD. For those customers purchasing one of the digital formats in which this book is available, we are pleased to offer the CD/DVD content as a free download via O'Reilly Media's Digital Distribution services. To download this content, please visit O'Reilly's web site, search for the title of this book to find its catalog page, and click on the link below the cover image (Examples, Companion Content, or Practice Files). Note that while we provide as much of the media content as we are able via free download, we are sometimes limited by licensing restrictions. Please direct any questions or concerns to firstname.lastname@example.org.
Your hands-on, step-by-step guide to learning Visual Basic 2010.
Teach yourself the essential tools and techniques for Visual Basic 2010-one step at a time. No matter what your skill level, you'll find the practical guidance and examples you need to start building professional applications for Windows and the Web.
Discover how to:
- Work in the Microsoft Visual Studio 2010 Integrated Development Environment (IDE)
- Master essential techniques-from managing data and variables to using inheritance and dialog boxes
- Create professional-looking Uis; add visual effects and print support
- Build compelling Web features with the Visual Web Developer tool
- Use Microsoft ADO.NET and advanced data presentation controls
- Debug your programs and handle run-time errors
- Use new features, such as Query Builder, and Microsoft .NET Framework
For customers who purchase an ebook version of this title, instructions for downloading the CD files can be found in the ebook.
About the Author
Michael Halvorson has written more than 30 books, including the popular Microsoft Visual Basic 2008 Step by Step, Microsoft Office XP Inside Out, and Microsoft Visual Basic 6.0 Professional Step by Step. A former Visual Basic localization manager at Microsoft, Michael is a professor at Pacific Lutheran University.
Table of Contents
Acknowledgments; Introduction; Visual Basic Versions; Finding Your Best Starting Point in This Book; Hardware and Software Requirements; Prerelease Software; Installing and Using the Practice Files; Uninstalling the Practice Files; Conventions and Features in This Book; Helpful Support Links; Support for This Book; Part I: Getting Started with Microsoft Visual Basic 2010; Chapter 1: Exploring the Visual Studio Integrated Development Environment; 1.1 The Visual Studio Development Environment; 1.2 The Visual Studio Tools; 1.3 The Properties Window; 1.4 Moving and Resizing the Programming Tools; 1.5 Switching Among Open Files and Tools by Using the IDE Navigator; 1.6 Opening a Web Browser Within Visual Studio; 1.7 Getting Help; 1.8 Customizing IDE Settings to Match Step-by-Step Exercises; 1.9 One Step Further: Exiting Visual Studio; 1.10 Chapter 1 Quick Reference; Chapter 2: Writing Your First Program; 2.1 Lucky Seven: Your First Visual Basic Program; 2.2 Programming Steps; 2.3 Creating the User Interface; 2.4 Setting the Properties; 2.5 The Picture Box Properties; 2.6 Writing the Code; 2.7 A Look at the Button1_Click Procedure; 2.8 Running Visual Basic Applications; 2.9 Sample Projects on Disk; 2.10 Building an Executable File; 2.11 Deploying Your Application; 2.12 One Step Further: Adding to a Program; 2.13 Chapter 2 Quick Reference; Chapter 3: Working with Toolbox Controls; 3.1 The Basic Use of Controls: The Hello World Program; 3.2 Using the DateTimePicker Control; 3.3 Controls for Gathering Input; 3.4 One Step Further: Using the LinkLabel Control; 3.5 Chapter 3 Quick Reference; Chapter 4: Working with Menus, Toolbars, and Dialog Boxes; 4.1 Adding Menus by Using the MenuStrip Control; 4.2 Adding Access Keys to Menu Commands; 4.3 Processing Menu Choices; 4.4 Adding Toolbars with the ToolStrip Control; 4.5 Using Dialog Box Controls; 4.6 Event Procedures That Manage Common Dialog Boxes; 4.7 One Step Further: Assigning Shortcut Keys to Menus; 4.8 Chapter 4 Quick Reference; Part II: Programming Fundamentals; Chapter 5: Visual Basic Variables and Formulas and the .NET Framework; 5.1 The Anatomy of a Visual Basic Program Statement; 5.2 Using Variables to Store Information; 5.3 Using Variables in a Program; 5.4 Using a Variable to Store Input; 5.5 Using a Variable for Output; 5.6 Working with Specific Data Types; 5.7 Working with Visual Basic Operators; 5.8 Working with Math Methods in the .NET Framework; 5.9 One Step Further: Establishing Order of Precedence; 5.10 Chapter 5 Quick Reference; Chapter 6: Using Decision Structures; 6.1 Event-Driven Programming; 6.2 Using Conditional Expressions; 6.3 If
Then Decision Structures; 6.4 Select Case Decision Structures; 6.5 One Step Further: Detecting Mouse Events; 6.6 Chapter 6 Quick Reference; Chapter 7: Using Loops and Timers; 7.1 Writing For
Next Loops; 7.2 Using a Counter Variable in a Multiline TextBox Control; 7.3 Creating Complex For
Next Loops; 7.4 Writing Do Loops; 7.5 Avoiding an Endless Loop; 7.6 The Timer Control; 7.7 Creating a Digital Clock by Using a Timer Control; 7.8 Using a Timer Object to Set a Time Limit; 7.9 One Step Further: Inserting Code Snippets; 7.10 Chapter 7 Quick Reference; Chapter 8: Debugging Visual Basic Programs; 8.1 Finding and Correcting Errors; 8.2 Three Types of Errors; 8.3 Identifying Logic Errors; 8.4 Debugging 101: Using Debugging Mode; 8.5 Tracking Variables by Using a Watch Window; 8.6 Visualizers: Debugging Tools That Display Data; 8.7 Using the Immediate and Command Windows; 8.8 Switching to the Command Window; 8.9 One Step Further: Removing Breakpoints; 8.10 Chapter 8 Quick Reference; Chapter 9: Trapping Errors by Using Structured Error Handling; 9.1 Processing Errors by Using the Try
Catch Statement; 9.2 Writing a Disc Drive Error Handler; 9.3 Using the Finally Clause to Perform Cleanup Tasks; 9.4 More Complex Try
Catch Error Handlers; 9.5 Comparing Error Handlers with Defensive Programming Techniques; 9.6 One Step Further: The Exit Try Statement; 9.7 Chapter 9 Quick Reference; Chapter 10: Creating Modules and Procedures; 10.1 Working with Modules; 10.2 Working with Public Variables; 10.3 Creating Procedures; 10.4 Writing Function Procedures; 10.5 Writing Sub Procedures; 10.6 One Step Further: Passing Arguments by Value and by Reference; 10.7 Chapter 10 Quick Reference; Chapter 11: Using Arrays to Manage Numeric and String Data; 11.1 Working with Arrays of Variables; 11.2 Preserving Array Contents by Using ReDim Preserve; 11.3 One Step Further: Processing Large Arrays by Using Methods in the Array Class; 11.4 Chapter 11 Quicccccck Reference; Chapter 12: Working with Collections; 12.1 Working with Object Collections; 12.2 Creating Your Own Collections; 12.3 One Step Further: VBA Collections; 12.4 Chapter 12 Quick Reference; Chapter 13: Exploring Text Files and String Processing; 13.1 Reading Text Files; 13.2 Writing Text Files; 13.3 Processing Strings with the String Class; 13.4 Sorting Text; 13.5 Protecting Text with Basic Encryption; 13.6 One Step Further: Using the Xor Operator; 13.7 Chapter 13 Quick Reference; Part III: Designing the User Interface; Chapter 14: Managing Windows Forms and Controls at Run Time; 14.1 Adding New Forms to a Program; 14.2 How Forms Are Used; 14.3 Working with Multiple Forms; 14.4 Positioning Forms on the Windows Desktop; 14.5 Adding Controls to a Form at Run Time; 14.6 Organizing Controls on a Form; 14.7 One Step Further: Specifying the Startup Object; 14.8 Chapter 14 Quick Reference; Chapter 15: Adding Graphics and Animation Effects; 15.1 Adding Artwork by Using the System.Drawing Namespace; 15.2 Adding Animation to Your Programs; 15.3 Expanding and Shrinking Objects While a Program is Running; 15.4 One Step Further: Changing Form Transparency; 15.5 Chapter 15 Quick Reference; Chapter 16: Inheriting Forms and Creating Base Classes; 16.1 Inheriting a Form by Using the Inheritance Picker; 16.2 Creating Your Own Base Classes; 16.3 One Step Further: Inheriting a Base Class; 16.4 Chapter 16 Quick Reference; Chapter 17: Working with Printers; 17.1 Using the PrintDocument Class; 17.2 Printing Multipage Text Files; 17.3 One Step Further: Adding Print Preview and Page Setup Dialog Boxes; 17.4 Chapter 17 Quick Reference; Part IV: Database and Web Programming; Chapter 18: Getting Started with ADO .NET; 18.1 Database Programming with ADO.NET; 18.2 Using Bound Controls to Display Database Information; 18.3 One Step Further: SQL Statements, LINQ, and Filtering Data; 18.4 Chapter 18 Quick Reference; Chapter 19: Data Presentation Using the DataGridView Control; 19.1 Using DataGridView to Display Database Records; 19.2 Formatting DataGridView Cells; 19.3 Adding a Second Data Grid View Object; 19.4 One Step Further: Updating the Original Database; 19.5 Chapter 19 Quick Reference; Chapter 20: Creating Web Sites and Web Pages by Using Visual Web Developer and ASP.NET; 20.1 Inside ASP.NET; 20.2 Building a Web Site by Using Visual Web Developer; 20.3 Using the Web Page Designer; 20.4 Adding Server Controls to a Web Site; 20.5 Customizing the Web Site Template; 20.6 Displaying Database Records on a Web Page; 20.7 One Step Further: Setting Web Site Titles in Internet Explorer; 20.8 Chapter 20 Quick Reference; Where to Go for More Information; Visual Basic Web Sites; Video Web Sites; Books about Visual Basic and Visual Studio Programming;