You are previewing Visual Basic 2012 Programmer's Reference.
O'Reilly logo
Visual Basic 2012 Programmer's Reference

Book Description

The comprehensive guide to Visual Basic 2012

Microsoft Visual Basic (VB) is the most popular programming language in the world, with millions of lines of code used in businesses and applications of all types and sizes. In this edition of the bestselling Wrox guide, Visual Basic expert Rod Stephens offers novice and experienced developers a comprehensive tutorial and reference to Visual Basic 2012. This latest edition introduces major changes to the Visual Studio development platform, including support for developing mobile applications that can take advantage of the Windows 8 operating system.

  • This new edition includes information on developing Win8-compatible Metro applications using pre-loaded templates

  • Explores the new design features and support for WPF designers

  • Explains how to develop Windows smartphone apps

  • Covers new VB language features such as Asynch and Await

  • Visual Basic 2012 Programmer's Reference is the programmer's go-to reference for the 2012 edition of Visual Basic.

    Table of Contents

    1. Cover
    2. Contents
    3. Part I: IDE
      1. Chapter 1: Introduction To The IDE
        1. Introducing the IDE
        2. Different IDE Appearances
        3. IDE Configurations
        4. Projects and Solutions
        5. Starting the IDE
        6. Creating a Project
        7. Saving a Project
        8. Summary
      2. Chapter 2: Menus, Toolbars, and Windows
        1. IDE Tools
        2. Menus
        3. Toolbars
        4. Secondary Windows
        5. Summary
      3. Chapter 3: Windows Forms Designer
        1. Introducing Windows Forms Designer
        2. Setting Designer Options
        3. Adding Controls
        4. Selecting Controls
        5. Copying Controls
        6. Moving and Sizing Controls
        7. Arranging Controls
        8. Setting Properties
        9. Adding Code to Controls
        10. Summary
      4. Chapter 4: WPF Designer
        1. Introducing WPF Designer
        2. Editor Weaknesses
        3. Recognizing Designer Windows
        4. Adding Controls
        5. Selecting Controls
        6. Moving and Sizing Controls
        7. Setting Properties
        8. Setting Group Properties
        9. Adding Code to Controls
        10. Summary
      5. Chapter 5: Visual Basic Code Editor
        1. Editing Code
        2. Margin Icons
        3. Outlining
        4. Tooltips
        5. IntelliSense
        6. Code Coloring and Highlighting
        7. Code Snippets
        8. Architectural Tools
        9. The Code Editor at Run Time
        10. Summary
      6. Chapter 6: Debugging
        1. Debugging and Testing
        2. The Debug Menu
        3. The Debug ⇒ Windows Submenu
        4. The Breakpoints Window
        5. The Command and Immediate Windows
        6. Summary
    4. Part II: Getting Started
      1. Chapter 7: Selecting Windows Forms Controls
        1. Controls
        2. Controls Overview
        3. Choosing Controls
        4. Third-Party Controls
        5. Summary
      2. Chapter 8: Using Windows Forms Controls
        1. Using Controls and Components
        2. Controls and Components
        3. Creating Controls
        4. Properties
        5. Methods
        6. Events
        7. Summary
      3. Chapter 9: Windows Forms
        1. Using Forms
        2. Transparency
        3. About, Splash, and Login Forms
        4. Mouse Cursors
        5. Icons
        6. Properties Adopted by Child Controls
        7. Property Reset Methods
        8. Overriding WndProc
        9. MRU Lists
        10. Dialog Boxes
        11. Wizards
        12. Summary
      4. Chapter 10: Selecting WPF Controls
        1. WPF Controls and Code
        2. Controls Overview
        3. Containing and Arranging Controls
        4. Making Selections
        5. Entering Data
        6. Displaying Data
        7. Providing Feedback
        8. Initiating Action
        9. Presenting Graphics and Media
        10. Providing Navigation
        11. Managing Documents
        12. Digital Ink
        13. Summary
      5. Chapter 11: Using Wpf Controls
        1. WPF Controls
        2. WPF Concepts
        3. WPF in the IDE
        4. XAML Features
        5. Procedural WPF
        6. Documents
        7. Summary
      6. Chapter 12: WPF Windows
        1. Using WPF Windows
        2. Window Applications
        3. Page Applications
        4. Summary
      7. Chapter 13: Program and Module Structure
        1. Solutions and Projects
        2. Hidden Files
        3. Code File Structure
        4. Typographic Code Elements
        5. Summary
      8. Chapter 14: Data Types, Variables, and Constants
        1. Variables
        2. Data Types
        3. Type Characters
        4. Data Type Conversion
        5. Variable Declarations
        6. Initializing Collections
        7. Option Explicit and Option Strict
        8. Scope
        9. Parameter Declarations
        10. Property Procedures
        11. Enumerated Data Types
        12. Anonymous Types
        13. Nullable Types
        14. Constants
        15. Delegates
        16. Naming Conventions
        17. Summary
      9. Chapter 15: Operators
        1. Understanding Operators
        2. Arithmetic Operators
        3. Concatenation Operators
        4. Comparison Operators
        5. Logical Operators
        6. Bitwise Operators
        7. Operator Precedence
        8. Assignment Operators
        9. The StringBuilder Class
        10. Date and TimeSpan Operations
        11. Operator Overloading
        12. Summary
      10. Chapter 16: Subroutines and Functions
        1. Managing Code
        2. Subroutines
        3. Functions
        4. Property Procedures
        5. Extension Methods
        6. Lambda Functions
        7. Relaxed Delegates
        8. Asynchronous Methods
        9. Summary
      11. Chapter 17: Program Control Statements
        1. Controlling Programs
        2. Decision Statements
        3. Looping Statements
        4. Summary
      12. Chapter 18: Error Handling
        1. The Struggle for Perfection
        2. Bugs versus Unplanned Conditions
        3. Structured Error Handling
        4. Debugging
        5. Summary
      13. Chapter 19: Database Controls and Objects
        1. Data Sources
        2. Automatically Connecting to Data
        3. Automatically Created Objects
        4. Other Data Objects
        5. Data Overview
        6. Connection Objects
        7. Transaction Objects
        8. Data Adapters
        9. Command Objects
        10. DataView
        11. DataRowView
        12. Simple Data Binding
        13. CurrencyManager
        14. Complex Data Binding
        15. Summary
      14. Chapter 20: LINQ
        1. The Many Faces of LINQ
        2. Introduction to LINQ
        3. Basic LINQ Query Syntax
        4. Advanced LINQ Query Syntax
        5. LINQ Functions
        6. LINQ Extension Methods
        7. LINQ to Objects
        8. LINQ to XML
        9. LINQ into XML
        10. LINQ out of XML
        11. LINQ to ADO.NET
        12. PLINQ
        13. Summary
      15. Chapter 21: Metro-Style Applications
        1. Building Metro-Style Applications
        2. Starting a New Project
        3. Special Image Files
        4. Building MetroBones
        5. Testing
        6. Summary
    5. Part III: Object-Oriented Programming
      1. Chapter 22: OOP Concepts
        1. Introducing OOP
        2. Classes
        3. Encapsulation
        4. Inheritance
        5. Polymorphism
        6. Method Overloading
        7. Extension Methods
        8. Summary
      2. Chapter 23: Classes and Structures
        1. Packaging Data
        2. Classes
        3. Structures
        4. Class Instantiation Details
        5. Structure Instantiation Details
        6. Garbage Collection
        7. Constants, Properties, and Methods
        8. Events
        9. Summary
      3. Chapter 24: Namespaces
        1. Handling Name Conflicts
        2. The Imports Statement
        3. The Root Namespace
        4. Making Namespaces
        5. Classes, Structures, and Modules
        6. Resolving Namespaces
        7. Summary
      4. Chapter 25: Collection Classes
        1. Grouping Data
        2. What Is a Collection?
        3. Arrays
        4. Collections
        5. Dictionaries
        6. CollectionsUtil
        7. Stacks and Queues
        8. Generics
        9. Collection Initializers
        10. Iterators
        11. Summary
      5. Chapter 26: Generics
        1. Class Creators
        2. Advantages of Generics
        3. Defining Generics
        4. Instantiating Generic Classes
        5. Generic Collection Classes
        6. Generic Methods
        7. Generics and Extension Methods
        8. Summary
    6. Part IV: Interacting With The Environment
      1. Chapter 27: Printing
        1. Printing Concepts
        2. Basic Printing
        3. Drawing Basics
        4. A Booklet Example
        5. Summary
      2. Chapter 28: Configuration and Resources
        1. The Need for Configuration
        2. My
        3. Environment
        4. Registry
        5. Configuration Files
        6. Resource Files
        7. Application
        8. Summary
      3. Chapter 29: Streams
        1. Stream Concepts
        2. Stream
        3. FileStream
        4. MemoryStream
        5. BinaryReader and BinaryWriter
        6. TextReader and TextWriter
        7. StringReader and StringWriter
        8. StreamReader and StreamWriter
        9. OpenText, CreateText, and AppendText
        10. Custom Stream Classes
        11. Summary
      4. Chapter 30: Filesystem Objects
        1. Programming Approaches
        2. Permissions
        3. Visual Basic Methods
        4. .NET Framework Classes
        5. My.Computer.FileSystem
        6. My.Computer.FileSystem.SpecialDirectories
        7. Summary
    7. Appendices
      1. Appendix A: Useful Control Properties, Methods, and Events
      2. Appendix B: Variable Declarations and Data Types
      3. Appendix C: Operators
      4. Appendix D: Subroutine and Function Declarations
      5. Appendix E: Control Statements
      6. Appendix F: Error Handling
      7. Appendix G: Windows Forms Controls and Components
      8. Appendix H: WPF Controls
      9. Appendix I: Visual Basic Power Packs
      10. Appendix J: Form Objects
      11. Appendix K: Classes and Structures
      12. Appendix L: LINQ
      13. Appendix M: Generics
      14. Appendix N: Graphics
      15. Appendix O: Useful Exception Classes
      16. Appendix P: Date And Time Format Specifiers
      17. Appendix Q: Other Format Specifiers
      18. Appendix R: The Application Class
      19. Appendix S: The My Namespace
      20. Appendix T: Streams
      21. Appendix U: Filesystem Classes
      22. Appendix V: Visual Studio Versions
    8. Introduction
    9. Advertisements