Microsoft Visual Basic 2010 Step by Step

Paperback
from $0.00

Author: Michael Halvorson

ISBN-10: 0735626693

ISBN-13: 9780735626690

Category: Programming Languages

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...

Search in google:

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 DVDThe 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 booktech@oreilly.com.

AcknowledgmentsIntroductionPart I Getting Started with Microsoft Visual Basic 20101 Exploring the Visual Studio Integrated Development Environment 3The Visual Studio Development Environment 4The Visual Studio Tools 7The Designer 10Running a Visual Basic Program 11The Properties Window 13Moving and Resizing the Programming Tools 17Moving and Resizing Tool Windows 18Docking Tool Windows 19Hiding Tool Windows 21Switching Among Open Files and Tools by Using the IDE Navigator 22Opening a Web Browser Within Visual Studio 23Getting Help 24Managing Help Settings 25Using F1 Help 26Customizing IDE Settings to Match Step-by-Step Exercises 29Setting the IDE for Visual Basic Development 29Checking Project and Compiler Settings 31One Step Further: Exiting Visual Studio 33Chapter 1 Quick Reference 342 Writing Your First Program 37Lucky Seven: Your First Visual Basic Program 37Programming Steps 38Creating the User Interface 38Setting the Properties 45The Picture Box Properties 49Writing the Code 52A Look at the Button1_Click Procedure 56Running Visual Basic Applications 58Sample Projects on Disk 59Building an Executable File 60Deploying Your Application 62One Step Further: Adding to a Program 63Chapter 2 Quick Reference 643 Working with Toolbox Controls 67The Basic Use of Controls: The Hello World Program 67Using the DateTimePicker Control 73The Birthday Program 73Controls for Gathering Input 78Using Group Boxes and Radio Buttons 81Processing Input with List Boxes 84A Word About Terminology 89One Step Further: Using the LinkLabel Control 91Chapter 3 Quick Reference 954 Working with Menus, Toolbars, and Dialog Boxes 97Adding Menus by Using the MenuStrip Control 97Adding Access Keys to Menu Commands 99Processing Menu Choices 102Adding Toolbars with the ToolStrip Control 107Using Dialog Box Controls 110Event Procedures That Manage Common Dialog Boxes 112One Step Further: Assigning Shortcut Keys to Menus 117Chapter 4 Quick Reference 119Part II Programming Fundamentals5 Visual Basic Variables and Formulas, and the .NET Framework 123The Anatomy of a Visual Basic Program Statement 123Using Variables to Store Information 124Setting Aside Space for Variables: The Dim Statement 124Implicit Variable Declaration 126Using Variables in a Program 127Using a Variable to Store Input 130Using a Variable for Output 133Working with Specific Data Types 135Constants: Variables That Don't Change 142Working with Visual Basic Operators 143Basic Math: The +,-, and / Operators 144Using Advanced Operators: \\, Mod, ebugging Mode 212Tracking Variables by Using a Watch Window 217Visualizers: Debugging Tools That Display Data 220Using the Immediate and Command Windows 221Switching to the Command Window 223One Step Further: Removing Breakpoints 224Chapter 8 Quick Reference 2259 Trapping Errors by Using Structured Error Handling 227Processing Errors by Using the Try...Catch Statement 227When to Use Error Handlers 228Setting the Trap: The Try...Catch Code Block 229Path and Disc Drive Errors 229Writing a Disc Drive Error Handler 233Using the Finally Clause to Perform Cleanup Tasks 234More Complex Try...Catch Error Handlers 236The Exception Object 236Specifying a Retry Period 239Using Nested Try...Catch Blocks 242Comparing Error Handlers with Defensive Programming Techniques 242One Step Further: The Exit Try Statement 243Chapter 9 Quick Reference 24410 Creating Modules and Procedures 247Working with Modules 247Creating a Module 248Working with Public Variables 251Creating Procedures 255Writing Function Procedures 256Function Syntax 257Calling a Function Procedure 258Using a Function to Perform a Calculation 258Writing Sub Procedures 262Sub Procedure Syntax 262Calling a Sub Procedure 263Using a Sub Procedure to Manage Input 264One Step Further: Passing Arguments by Value and by Reference 268Chapter 10 Quick Reference 27011 Using Arrays to Manage Numeric and String Data 273Working with Arrays of Variables 273Creating an Array 274Declaring a Fixed-Size Array 275Setting Aside Memory 276Working with Array Elements 277Declaring an Array and Assigning It Initial Values 278Creating a Fixed-Size Array to Hold Temperatures 279Creating a Dynamic Array 283Preserving Array Contents by Using ReDim Preserve 287Using ReDim for Three-Dimensional Arrays 288One Step Further: Processing Large Arrays by Using Methods in the Array Class 288The Array Class 288Chapter 11 Quick Reference 29512 Working with Collections 297Working with Object Collections 297Referencing Objects in a Collection 298Writing For Each...Next Loops 298Experimenting with Objects in the Controls Collection 299Using the Name Property in a For Each...Next Loop 302Creating Your Own Collections 304Declaring New Collections 304One Step Further: VBA Collections 309Entering the Word Macro 310Chapter 12 Quick Reference 31113 Exploring Text Files and String Processing 313Reading Text Files 313The My Namespace 314The StreamReader Class 316Using the ReadAllText Method 317Writing Text Files 321The WriteAllText Method 321The StreamWriter Class 322Using the WriteAllText Method 323Processing Strings with the String Class 326Sorting Text 329Working with ASCII Codes 330Sorting Strings in a Text Box 331Examining the Sort Text Program Code 334Protecting Text with Basic Encryption 336One Step Further: Using the Xor Operator 340Examining the Encryption Program Code 342Chapter 13 Quick Reference 345Part III Designing the User Interface14 Managing Windows Forms and Controls at Run Time 351Adding New Forms to a Program 351How Forms Are Used 352Working with Multiple Forms 352Using the DialogResult Property in the Calling Form 358Positioning Forms on the Windows Desktop 359Minimizing, Maximizing, and Restoring Windows 364Adding Controls to a Form at Run Time 364Organizing Controls on a Form 367One Step Further: Specifying the Startup Object 371Chapter 14 Quick Reference 37315 Adding Graphics and Animation Effects 375Adding Artwork by Using the System Drawing Namespace 376Using a Form's Coordinate System 376The System.Drawing. Graphics Class 376Using the Form's Paint Event 378Adding Animation to Your Programs 380Moving Objects on the Form 380The Location Property 381Creating Animation by Using a Timer Object 382Expanding and Shrinking Objects While a Program is Running 386One Step Further: Changing Form Transparency 388Chapter 15 Quick Reference 39016 Inheriting Forms and Creating Base Classes 393Inheriting a Form by Using the Inheritance Picker 393Creating Your Own Base Classes 399Adding a New Class to Your Project 401One Step Further: Inheriting a Base Class 408Chapter 16 Quick Reference 41217 Working with Printers 415Using the PrintDocument Class 415Printing Text from a Text Box Object 420Printing Multipage Text Files 424One Step Further: Adding Print Preview and Page Setup Dialog Boxes 430Chapter 17 Quick Reference 437Part IV Database and Web Programming18 Getting Started with ADO.NET 441Database Programming with ADO.NET 441Database Terminology 442Working with an Access Database 444The Data Sources Window 452Using Bound Controls to Display Database Information 458One Step Further: SQL Statements, LINQ, and Filtering Data 461Chapter 18 Quick Reference 46619 Data Presentation Using the DataGridView Control 467Using DataGridView to Display Database Records 467Formatting DataGridView Cells 479Adding a Second Data Grid View Object 482One Step Further: Updating the Original Database 485Chapter 19 Quick Reference 48820 Creating Web Sites and Web Pages by Using Visual Web Developer and ASP.NET 491Inside ASP.NET 491Web Pages vs. Windows Forms 493Server Controls 493HTML Controls 494Building a Web Site by Using Visual Web Developer 495Considering Software Requirements for ASP.NET Programming 495Using the Web Page Designer 498Adding Server Controls to a Web Site 501Writing Event Procedures for Web Page Controls 504Customizing the Web Site Template 509Displaying Database Records on a Web Page 512One Step Further: Setting Web Site Titles in Internet Explorer 519Chapter 20 Quick Reference 522Appendix: Where to Go for More Information 523Index 529