Visual Basic® 2008 Programmer's Reference

Book description

Providing programmers and developers of all skill levels with a comprehensive tutorial and reference to Visual Basic (VB) 2008, Microsoft MVP Rod Stephens presents a broad, solid understanding of essential topics on the latest version of VB. He explains the forms, controls, and other objects that VB furnishes for building applications in a modern windows environment. Plus, he examines the powerful development environment that makes VB such a productive language, and he delves into the VB language itself to show you how to use it to perform an array of important development tasks.

Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file.

Table of contents

  1. Copyright
  2. About the Author
  3. Credits
  4. Acknowledgments
  5. Introduction
    1. Should You Use Visual Basic 2008?
    2. Who Should Read This Book
    3. How This Book Is Organized
      1. Part I: IDE
      2. Part II: Getting Started
      3. Part III: Object-Oriented Programming
      4. Part IV: Graphics
      5. Part V: Interacting with the Environment
      6. Part VI: Appendixes
    4. How to Use This Book
    5. Necessary Equipment
    6. Conventions
    7. The Book's Web Site
    8. Wrox Errata
    9. p2p.wrox.com
    10. Visual Basic 2008 Version 1 Warning
  6. I. IDE
    1. 1. Introduction to the IDE
      1. 1.1. Different IDE Appearance
      2. 1.2. IDE Configurations
      3. 1.3. Projects and Solutions
      4. 1.4. Starting the IDE
      5. 1.5. Creating a Project
      6. 1.6. Saving a Project
      7. 1.7. Summary
    2. 2. Menus, Toolbars, and Windows
      1. 2.1. Menus
        1. 2.1.1. File
        2. 2.1.2. Edit
        3. 2.1.3. View
        4. 2.1.4. Project
        5. 2.1.5. Build
        6. 2.1.6. Debug
        7. 2.1.7. Data
        8. 2.1.8. Format
        9. 2.1.9. Tools
          1. 2.1.9.1. Macros
          2. 2.1.9.2. Options
        10. 2.1.10. Test
        11. 2.1.11. Window
        12. 2.1.12. Community
        13. 2.1.13. Help
      2. 2.2. Toolbars
      3. 2.3. Secondary Windows
        1. 2.3.1. Toolbox
        2. 2.3.2. Properties Window
      4. 2.4. Summary
    3. 3. Customization
      1. 3.1. Adding Commands
      2. 3.2. Removing Commands
      3. 3.3. Modifying Commands
      4. 3.4. Making Keyboard Shortcuts
      5. 3.5. Summary
    4. 4. Windows Form Designer
      1. 4.1. Setting Designer Options
      2. 4.2. Adding Controls
      3. 4.3. Selecting Controls
      4. 4.4. Copying Controls
      5. 4.5. Moving and Sizing Controls
      6. 4.6. Arranging Controls
      7. 4.7. Setting Properties
        1. 4.7.1. Setting Group Properties
        2. 4.7.2. Setting Properties for Several Controls
        3. 4.7.3. Using Smart Tags
        4. 4.7.4. Using Command Verbs
      8. 4.8. Adding Code to Controls
      9. 4.9. Summary
    5. 5. WPF Designer
      1. 5.1. Early Version Warning
      2. 5.2. Recognizing Designer Windows
      3. 5.3. Adding Controls
      4. 5.4. Selecting Controls
      5. 5.5. Copying Controls
      6. 5.6. Moving and Sizing Controls
      7. 5.7. Setting Properties
      8. 5.8. Setting Group Properties
      9. 5.9. Adding Code to Controls
      10. 5.10. Summary
    6. 6. Visual Basic Code Editor
      1. 6.1. Margin Icons
      2. 6.2. Outlining
      3. 6.3. Tooltips
      4. 6.4. IntelliSense
      5. 6.5. Code Coloring and Highlighting
      6. 6.6. Code Snippets
        1. 6.6.1. Using Snippets
        2. 6.6.2. Creating Snippets
      7. 6.7. The Code Editor at Runtime
      8. 6.8. Summary
    7. 7. Debugging
      1. 7.1. The Debug Menu
      2. 7.2. The Debug Windows Submenu
      3. 7.3. The Breakpoints Window
      4. 7.4. The Command and Immediate Windows
      5. 7.5. Summary
  7. II. Getting Started
    1. 8. Selecting Windows Forms Controls
      1. 8.1. Controls Overview
      2. 8.2. Choosing Controls
        1. 8.2.1. Containing and Arranging Controls
        2. 8.2.2. Making Selections
        3. 8.2.3. Entering Data
        4. 8.2.4. Displaying Data
        5. 8.2.5. Providing Feedback
        6. 8.2.6. Initiating Action
        7. 8.2.7. Displaying Graphics
        8. 8.2.8. Displaying Dialog Boxes
        9. 8.2.9. Supporting Other Controls
      3. 8.3. Third-Party Controls
      4. 8.4. Summary
    2. 9. Using Windows Forms Controls
      1. 9.1. Controls and Components
      2. 9.2. Creating Controls
        1. 9.2.1. Creating Controls at Design Time
        2. 9.2.2. Adding Controls to Containers
        3. 9.2.3. Creating Controls at Runtime
      3. 9.3. Properties
        1. 9.3.1. Properties at Design Time
          1. 9.3.1.1. Compound Properties
          2. 9.3.1.2. Restricted Properties
          3. 9.3.1.3. Collection Properties
        2. 9.3.2. Properties at Runtime
        3. 9.3.3. Useful Control Properties
          1. 9.3.3.1. Anchor and Dock
          2. 9.3.3.2. Dock
        4. 9.3.4. Position and Size Properties
      4. 9.4. Methods
      5. 9.5. Events
        1. 9.5.1. Creating Event Handlers at Design Time
        2. 9.5.2. WithEvents Event Handlers
        3. 9.5.3. Setting Event Handlers at Runtime
        4. 9.5.4. Control Array Events
        5. 9.5.5. Validation Events
          1. 9.5.5.1. Integrated Validation
          2. 9.5.5.2. Separated Validation
          3. 9.5.5.3. Deferred Validation
      6. 9.6. Summary
    3. 10. Windows Forms
      1. 10.1. Transparency
      2. 10.2. About, Splash, and Login Forms
      3. 10.3. Mouse Cursors
      4. 10.4. Icons
        1. 10.4.1. Application Icons
        2. 10.4.2. Notification Icons
      5. 10.5. Properties Adopted by Child Controls
      6. 10.6. Property Reset Methods
      7. 10.7. Overriding WndProc
      8. 10.8. SDI and MDI
        1. 10.8.1. MDI Features
        2. 10.8.2. MDI Events
        3. 10.8.3. MDI versus SDI
      9. 10.9. MRU Lists
      10. 10.10. Dialog Boxes
      11. 10.11. Wizards
      12. 10.12. Summary
    4. 11. Selecting WPF Controls
      1. 11.1. Controls Overview
      2. 11.2. Containing and Arranging Controls
      3. 11.3. Making Selections
      4. 11.4. Entering Data
      5. 11.5. Displaying Data
      6. 11.6. Providing Feedback
      7. 11.7. Initiating Action
      8. 11.8. Presenting Graphics and Media
      9. 11.9. Providing Navigation
      10. 11.10. Managing Documents
      11. 11.11. Digital Ink
      12. 11.12. Summary
    5. 12. Using WPF Controls
      1. 12.1. WPF Concepts
        1. 12.1.1. Separation of User Interface and Code
        2. 12.1.2. WPF Control Hierarchies
      2. 12.2. WPF in the IDE
        1. 12.2.1. Editing XAML
        2. 12.2.2. Editing Visual Basic Code
      3. 12.3. XAML Features
        1. 12.3.1. Objects
        2. 12.3.2. Resources
        3. 12.3.3. Styles
        4. 12.3.4. Templates
        5. 12.3.5. Transformations
        6. 12.3.6. Animations
        7. 12.3.7. Drawing Objects
          1. 12.3.7.1. Line
          2. 12.3.7.2. Ellipse
          3. 12.3.7.3. Rectangle
          4. 12.3.7.4. Polygon
          5. 12.3.7.5. Polyline
          6. 12.3.7.6. Path
      4. 12.4. Procedural WPF
      5. 12.5. Documents
        1. 12.5.1. Flow Documents
        2. 12.5.2. Fixed Documents
        3. 12.5.3. XPS Documents
      6. 12.6. Summary
    6. 13. WPF Windows
      1. 13.1. Window Applications
      2. 13.2. Page Applications
        1. 13.2.1. Browser Applications
        2. 13.2.2. Frame Applications
        3. 13.2.3. PageFunction Applications
        4. 13.2.4. Wizard Applications
      3. 13.3. Summary
    7. 14. Program and Module Structure
      1. 14.1. Hidden Files
      2. 14.2. Code File Structure
        1. 14.2.1. Code Regions
        2. 14.2.2. Conditional Compilation
          1. 14.2.2.1. Setting Constants in Code
          2. 14.2.2.2. Setting Constants with the Project's Compilation Settings
          3. 14.2.2.3. Predefined Constants
          4. 14.2.2.4. DEBUG
            1. 14.2.2.4.1. Assert
            2. 14.2.2.4.2. Fail
            3. 14.2.2.4.3. IndentSize, Indent, Unindent, and IndentLevel
            4. 14.2.2.4.4. Write, WriteLine, WriteIf, and WriteLineIf
          5. 14.2.2.5. TRACE
          6. 14.2.2.6. CONFIG
          7. 14.2.2.7. Debugging Level Constants
        3. 14.2.3. Namespaces
      3. 14.3. Typographic Code Elements
        1. 14.3.1. Comments
        2. 14.3.2. XML Comments
        3. 14.3.3. Line Continuation
        4. 14.3.4. Line Joining
        5. 14.3.5. Line Labels
      4. 14.4. Summary
    8. 15. Data Types, Variables, and Constants
      1. 15.1. Data Types
      2. 15.2. Type Characters
      3. 15.3. Data Type Conversion
        1. 15.3.1. Narrowing Conversions
        2. 15.3.2. Data Type Parsing Methods
        3. 15.3.3. Widening Conversions
      4. 15.4. Variable Declarations
        1. 15.4.1. Attribute_List
        2. 15.4.2. Accessibility
        3. 15.4.3. Shared
        4. 15.4.4. Shadows
        5. 15.4.5. ReadOnly
        6. 15.4.6. Dim
        7. 15.4.7. WithEvents
        8. 15.4.8. Name
        9. 15.4.9. Bounds_List
        10. 15.4.10. New
        11. 15.4.11. As Type and Inferred Types
        12. 15.4.12. Initialization_Expression
          1. 15.4.12.1. Initializing Arrays
          2. 15.4.12.2. Initializing Object Arrays
          3. 15.4.12.3. Initializing XML Variables
        13. 15.4.13. Multiple Variable Declarations
      5. 15.5. Option Explicit and Option Strict
      6. 15.6. Scope
        1. 15.6.1. Block Scope
        2. 15.6.2. Procedure Scope
        3. 15.6.3. Module Scope
        4. 15.6.4. Namespace Scope
        5. 15.6.5. Restricting Scope
      7. 15.7. Parameter Declarations
      8. 15.8. Property Procedures
      9. 15.9. Enumerated Data Types
      10. 15.10. Anonymous Types
      11. 15.11. Nullable Types
      12. 15.12. Constants
        1. 15.12.1. Accessibility
        2. 15.12.2. As Type
        3. 15.12.3. Initialization_Expression
      13. 15.13. Delegates
      14. 15.14. Naming Conventions
      15. 15.15. Summary
    9. 16. Operators
      1. 16.1. Arithmetic Operators
      2. 16.2. Concatenation Operators
      3. 16.3. Comparison Operators
      4. 16.4. Logical Operators
      5. 16.5. Bitwise Operators
      6. 16.6. Operator Precedence
      7. 16.7. Assignment Operators
      8. 16.8. The StringBuilder Class
      9. 16.9. Date and TimeSpan Operations
      10. 16.10. Operator Overloading
      11. 16.11. Operators with Nullable Types
      12. 16.12. Summary
    10. 17. Subroutines and Functions
      1. 17.1. Subroutines
        1. 17.1.1. Attribute_List
        2. 17.1.2. Inheritance_Mode
        3. 17.1.3. Accessibility
        4. 17.1.4. Subroutine_Name
        5. 17.1.5. Parameters
          1. 17.1.5.1. ByVal
          2. 17.1.5.2. ByRef
          3. 17.1.5.3. Arrays Declared ByVal and ByRef
          4. 17.1.5.4. Parenthesized Parameters
          5. 17.1.5.5. Optional
          6. 17.1.5.6. Optional versus Overloading
          7. 17.1.5.7. Parameter Arrays
        6. 17.1.6. Implements interface.subroutine
        7. 17.1.7. Statements
      2. 17.2. Functions
      3. 17.3. Property Procedures
      4. 17.4. Extension Methods
      5. 17.5. Lambda Functions
      6. 17.6. Relaxed Delegates
      7. 17.7. Partial Methods
      8. 17.8. Summary
    11. 18. Program Control Statements
      1. 18.1. Decision Statements
        1. 18.1.1. Single Line If Then
        2. 18.1.2. Multiline If Then
        3. 18.1.3. Select Case
          1. 18.1.3.1. To
          2. 18.1.3.2. Is
          3. 18.1.3.3. Comma-Separated Expressions
        4. 18.1.4. Enumerated Values
        5. 18.1.5. IIf
        6. 18.1.6. If
        7. 18.1.7. Choose
      2. 18.2. Looping Statements
        1. 18.2.1. For Next
        2. 18.2.2. Non-integer For Next Loops
        3. 18.2.3. For Each
        4. 18.2.4. Enumerators
        5. 18.2.5. Iterators
        6. 18.2.6. Do Loop Statements
        7. 18.2.7. While End
        8. 18.2.8. Exit and Continue
      3. 18.3. GoTo
      4. 18.4. Summary
    12. 19. Error Handling
      1. 19.1. Bugs versus Unplanned Conditions
        1. 19.1.1. Catching Bugs
        2. 19.1.2. Catching Unexpected Conditions
        3. 19.1.3. Global Exception Handling
      2. 19.2. Structured Error Handling
        1. 19.2.1. Exception Objects
        2. 19.2.2. StackTrace Objects
        3. 19.2.3. Throwing Exceptions
        4. 19.2.4. Custom Exceptions
      3. 19.3. Visual Basic Classic Error Handling
        1. 19.3.1. On Error GoTo Line
        2. 19.3.2. On Error Resume Next
        3. 19.3.3. On Error GoTo 0
        4. 19.3.4. On Error GoTo −1
        5. 19.3.5. Error-Handling Mode
      4. 19.4. Structured versus Classic Error Handling
      5. 19.5. The Err Object
      6. 19.6. Debugging
      7. 19.7. Summary
    13. 20. Database Controls and Objects
      1. 20.1. Automatically Connecting to Data
        1. 20.1.1. Connecting to the Data Source
        2. 20.1.2. Adding Data Controls to the Form
      2. 20.2. Automatically Created Objects
      3. 20.3. Other Data Objects
      4. 20.4. Data Overview
      5. 20.5. Connection Objects
      6. 20.6. Transaction Objects
      7. 20.7. Data Adapters
      8. 20.8. Command Objects
        1. 20.8.1. DataSet
        2. 20.8.2. DataTable
        3. 20.8.3. DataRow
        4. 20.8.4. DataColumn
        5. 20.8.5. DataRelation
        6. 20.8.6. Constraints
          1. 20.8.6.1. ForeignKeyConstraint
          2. 20.8.6.2. UniqueConstraint
      9. 20.9. DataView
      10. 20.10. DataRowView
      11. 20.11. Simple Data Binding
      12. 20.12. CurrencyManager
      13. 20.13. Complex Data Binding
      14. 20.14. Summary
    14. 21. LINQ
      1. 21.1. Introduction to LINQ
      2. 21.2. Basic LINQ Query Syntax
        1. 21.2.1. From
        2. 21.2.2. Where
        3. 21.2.3. Order By
        4. 21.2.4. Select
        5. 21.2.5. Using LINQ Results
      3. 21.3. Advanced LINQ Query Syntax
        1. 21.3.1. Join
        2. 21.3.2. Group By
        3. 21.3.3. Aggregate Functions
        4. 21.3.4. Set Operations
        5. 21.3.5. Limiting Results
      4. 21.4. LINQ Functions
      5. 21.5. LINQ Extension Methods
        1. 21.5.1. Method-Based Queries
        2. 21.5.2. Method-Based Queries with Lambda Functions
        3. 21.5.3. Extending LINQ
      6. 21.6. LINQ to Objects
      7. 21.7. LINQ to XML
        1. 21.7.1. XML Literals
        2. 21.7.2. LINQ Into XML
        3. 21.7.3. LINQ Out Of XML
      8. 21.8. LINQ to ADO.NET
        1. 21.8.1. LINQ to SQL and LINQ to Entities
        2. 21.8.2. LINQ to DataSet
      9. 21.9. Summary
    15. 22. Custom Controls
      1. 22.1. Custom Controls in General
        1. 22.1.1. Creating the Control Project
        2. 22.1.2. Setting the Toolbox Icon
        3. 22.1.3. Testing in the UserControl Test Container
        4. 22.1.4. Making a Test Project
        5. 22.1.5. Test the Control
        6. 22.1.6. Implement Properties, Methods, and Events
        7. 22.1.7. Assign Attributes
        8. 22.1.8. Manage Design Time and Runtime
      2. 22.2. Derived Controls
        1. 22.2.1. Shadowing Parent Features
        2. 22.2.2. Hiding Parent Features
      3. 22.3. Composite Controls
      4. 22.4. Controls Built from Scratch
      5. 22.5. Components
      6. 22.6. Invisible Controls
      7. 22.7. Picking a Control Class
      8. 22.8. Controls and Components in Executable Projects
        1. 22.8.1. UserControls in Executable Projects
        2. 22.8.2. Inherited UserControls in Executable Projects
        3. 22.8.3. Controls in Executable Projects
        4. 22.8.4. Inherited Controls in Executable Projects
        5. 22.8.5. Components in Executable Projects
      9. 22.9. Custom Component Security
        1. 22.9.1. Strongly Named Assemblies
        2. 22.9.2. Using a Signature Authority
      10. 22.10. Summary
    16. 23. Drag and Drop, and the Clipboard
      1. 23.1. Drag-and-Drop Events
        1. 23.1.1. A Simple Example
        2. 23.1.2. Learning Data Types Available
        3. 23.1.3. Dragging Within an Application
        4. 23.1.4. Accepting Dropped Files
        5. 23.1.5. Dragging Objects
        6. 23.1.6. Changing Format Names
        7. 23.1.7. Dragging Multiple Data Formats
      2. 23.2. Using the Clipboard
      3. 23.3. Summary
    17. 24. UAC Security
      1. 24.1. UAC Overview
      2. 24.2. Designing for UAC
      3. 24.3. Elevating Programs
        1. 24.3.1. User
        2. 24.3.2. Calling Program
        3. 24.3.3. Called Program
      4. 24.4. Summary
  8. III. Object-Oriented Programming
    1. 25. OOP Concepts
      1. 25.1. Classes
      2. 25.2. Encapsulation
      3. 25.3. Inheritance
        1. 25.3.1. Inheritance Hierarchies
        2. 25.3.2. Refinement and Abstraction
        3. 25.3.3. "Has-a" and "Is-a" Relationships
        4. 25.3.4. Adding and Modifying Class Features
        5. 25.3.5. Interface Inheritance
      4. 25.4. Polymorphism
      5. 25.5. Overloading
      6. 25.6. Extension Methods
      7. 25.7. Summary
    2. 26. Classes and Structures
      1. 26.1. Classes
        1. 26.1.1. Attribute_list
        2. 26.1.2. Partial
        3. 26.1.3. Accessibility
        4. 26.1.4. Shadows
        5. 26.1.5. Inheritance
        6. 26.1.6. Of type_list
        7. 26.1.7. Inherits parent_class
        8. 26.1.8. Implements interface
      2. 26.2. Structures
        1. 26.2.1. Structures Cannot Inherit
        2. 26.2.2. Structures Are Value Types
        3. 26.2.3. Memory Required
        4. 26.2.4. Heap and Stack Performance
        5. 26.2.5. Object Assignment
        6. 26.2.6. Parameter Passing
        7. 26.2.7. Boxing and Unboxing
      3. 26.3. Class Instantiation Details
      4. 26.4. Structure Instantiation Details
      5. 26.5. Garbage Collection
        1. 26.5.1. Finalize
        2. 26.5.2. Dispose
      6. 26.6. Constants, Properties, and Methods
      7. 26.7. Events
        1. 26.7.1. Declaring Events
          1. 26.7.1.1. attribute_list
          2. 26.7.1.2. accessibility
          3. 26.7.1.3. Shadows
          4. 26.7.1.4. parameters
          5. 26.7.1.5. Implements interface.event
        2. 26.7.2. Raising Events
        3. 26.7.3. Catching Events
        4. 26.7.4. Declaring Custom Events
        5. 26.7.5. Shared Variables
        6. 26.7.6. Shared Methods
      8. 26.8. Summary
    3. 27. Namespaces
      1. 27.1. The Imports Statement
        1. 27.1.1. Automatic Imports
        2. 27.1.2. Namespace Aliases
        3. 27.1.3. Namespace Elements
      2. 27.2. The Root Namespace
      3. 27.3. Making Namespaces
      4. 27.4. Classes, Structures, and Modules
      5. 27.5. Resolving Namespaces
      6. 27.6. Summary
    4. 28. Collection Classes
      1. 28.1. What Is a Collection?
      2. 28.2. Arrays
        1. 28.2.1. Array Dimensions
        2. 28.2.2. Lower Bounds
        3. 28.2.3. Resizing
        4. 28.2.4. Speed
        5. 28.2.5. Other Array Class Features
          1. 28.2.5.1. Array.Reverse
          2. 28.2.5.2. Array.Sort
          3. 28.2.5.3. Array.BinarySearch
      3. 28.3. Collections
        1. 28.3.1. ArrayList
        2. 28.3.2. StringCollection
        3. 28.3.3. Strongly Typed Collections
        4. 28.3.4. Read-Only Strongly Typed Collections
        5. 28.3.5. NameValueCollection
      4. 28.4. Dictionaries
        1. 28.4.1. ListDictionary
        2. 28.4.2. Hashtable
        3. 28.4.3. HybridDictionary
        4. 28.4.4. Strongly Typed Dictionaries
        5. 28.4.5. Other Strongly Typed Derived Classes
        6. 28.4.6. StringDictionary
        7. 28.4.7. SortedList
      5. 28.5. CollectionsUtil
      6. 28.6. Stacks and Queues
        1. 28.6.1. Stack
        2. 28.6.2. Queue
      7. 28.7. Generics
      8. 28.8. Summary
    5. 29. Generics
      1. 29.1. Advantages of Generics
      2. 29.2. Defining Generics
        1. 29.2.1. Generic Constructors
        2. 29.2.2. Multiple Types
        3. 29.2.3. Constrained Types
      3. 29.3. Using Generics
        1. 29.3.1. Imports Aliases
        2. 29.3.2. Derived Classes
      4. 29.4. Predefined Generic Classes
      5. 29.5. Generic Methods
      6. 29.6. Generics and Extension Methods
      7. 29.7. Summary
  9. IV. Graphics
    1. 30. Drawing Basics
      1. 30.1. Drawing Overview
      2. 30.2. Drawing Namespaces
        1. 30.2.1. System.Drawing
        2. 30.2.2. System.Drawing.Drawing2D
        3. 30.2.3. System.Drawing.Imaging
        4. 30.2.4. System.Drawing.Text
        5. 30.2.5. System.Drawing.Printing
      3. 30.3. Graphics
        1. 30.3.1. Drawing Methods
          1. 30.3.1.1. DrawBezier
          2. 30.3.1.2. DrawBeziers
          3. 30.3.1.3. DrawClosedCurve
          4. 30.3.1.4. DrawPath
        2. 30.3.2. Filling Methods
        3. 30.3.3. Other Graphics Properties and Methods
        4. 30.3.4. Anti-Aliasing
          1. 30.3.4.1. SmoothingMode
          2. 30.3.4.2. TextRenderingHint
          3. 30.3.4.3. InterpolationMode
          4. 30.3.4.4. Speed Considerations
        5. 30.3.5. Transformation Basics
          1. 30.3.5.1. Transformation Mathematics
          2. 30.3.5.2. Transformation Code
        6. 30.3.6. Advanced Transformations
        7. 30.3.7. Saving and Restoring Graphics State
      4. 30.4. Drawing Events
      5. 30.5. Summary
    2. 31. Brushes, Pens, and Paths
      1. 31.1. Pen
        1. 31.1.1. Alignment
        2. 31.1.2. CompoundArray
        3. 31.1.3. Custom Line Caps
        4. 31.1.4. Pen Transformations
      2. 31.2. Brush
        1. 31.2.1. SolidBrush
        2. 31.2.2. TextureBrush
        3. 31.2.3. HatchBrush
        4. 31.2.4. LinearGradientBrush
        5. 31.2.5. PathGradientBrush
      3. 31.3. GraphicsPath Objects
      4. 31.4. Garbage-Collection Issues
      5. 31.5. Summary
    3. 32. Text
      1. 32.1. Drawing Text
      2. 32.2. Text Formatting
        1. 32.2.1. FormatFlags
        2. 32.2.2. Tab Stops
        3. 32.2.3. Trimming
      3. 32.3. MeasureString
      4. 32.4. Font Metrics
      5. 32.5. Summary
    4. 33. Image Processing
      1. 33.1. Image
      2. 33.2. Bitmap
        1. 33.2.1. Loading Bitmaps
        2. 33.2.2. Saving Bitmaps
        3. 33.2.3. Implementing AutoRedraw
        4. 33.2.4. Pixel-by-Pixel Operations
          1. 33.2.4.1. GetPixel and SetPixel
          2. 33.2.4.2. Unsafe Pixel Manipulation
      3. 33.3. Metafile Objects
      4. 33.4. Summary
    5. 34. Printing
      1. 34.1. How Not to Print
      2. 34.2. Basic Printing
      3. 34.3. Printing Text
      4. 34.4. Centering Printouts
      5. 34.5. Fitting Pictures to the Page
      6. 34.6. Simplifying Drawing and Printing
      7. 34.7. Summary
    6. 35. Reporting
      1. 35.1. Report Objects
      2. 35.2. Building a Report
      3. 35.3. CrystalReportViewer
      4. 35.4. Customizing a Report
      5. 35.5. External Reports
      6. 35.6. ReportDocument
      7. 35.7. Summary
  10. V. Interacting with the Environment
    1. 36. Configuration and Resources
      1. 36.1. My
        1. 36.1.1. Me and My
        2. 36.1.2. My Sections
      2. 36.2. Environment
        1. 36.2.1. Setting Environment Variables
        2. 36.2.2. Using Environ
        3. 36.2.3. Using System.Environment
      3. 36.3. Registry
        1. 36.3.1. Native Visual Basic Registry Methods
        2. 36.3.2. My.Computer.Registry
      4. 36.4. Configuration Files
      5. 36.5. Resource Files
        1. 36.5.1. Application Resources
        2. 36.5.2. Using Application Resources
        3. 36.5.3. Embedded Resources
        4. 36.5.4. Satellite Resources
        5. 36.5.5. Localization Resources
        6. 36.5.6. ComponentResourceManager
      6. 36.6. Application
        1. 36.6.1. Application Properties
        2. 36.6.2. Application Methods
        3. 36.6.3. Application Events
      7. 36.7. Summary
    2. 37. Streams
      1. 37.1. Stream
      2. 37.2. FileStream
      3. 37.3. MemoryStream
      4. 37.4. BufferedStream
      5. 37.5. BinaryReader and BinaryWriter
      6. 37.6. TextReader and TextWriter
      7. 37.7. StringReader and StringWriter
      8. 37.8. StreamReader and StreamWriter
      9. 37.9. OpenText, CreateText, and AppendText
      10. 37.10. Custom Stream Classes
      11. 37.11. Summary
    3. 38. File-System Objects
      1. 38.1. Permissions
      2. 38.2. Visual Basic Methods
        1. 38.2.1. File Methods
        2. 38.2.2. File-System Methods
        3. 38.2.3. Sequential-File Access
        4. 38.2.4. Random-File Access
        5. 38.2.5. Binary-File Access
      3. 38.3. .NET Framework Classes
        1. 38.3.1. Directory
        2. 38.3.2. File
        3. 38.3.3. DriveInfo
        4. 38.3.4. DirectoryInfo
        5. 38.3.5. FileInfo
        6. 38.3.6. FileSystemInfo
        7. 38.3.7. FileSystemWatcher
        8. 38.3.8. Path
      4. 38.4. My.Computer.FileSystem
      5. 38.5. My.Computer.FileSystem.SpecialDirectories
      6. 38.6. Summary
    4. 39. Windows Communication Foundation
      1. 39.1. Early Version Warning
      2. 39.2. WCF Concepts
      3. 39.3. WCF Example
      4. 39.4. Building the Initial Service
      5. 39.5. Building QuoteService
      6. 39.6. Testing QuoteService
      7. 39.7. Building QuoteClient
      8. 39.8. Hosting the Service
      9. 39.9. Summary
    5. 40. Useful Namespaces
      1. 40.1. High-Level Namespaces
        1. 40.1.1. The Microsoft Namespace
        2. 40.1.2. The System Namespace
      2. 40.2. Advanced Examples
        1. 40.2.1. Regular Expressions
        2. 40.2.2. XML
        3. 40.2.3. Cryptography
        4. 40.2.4. Reflection
        5. 40.2.5. Direct3D
      3. 40.3. Summary
  11. VI. Appendices
  12. A. Useful Control Properties, Methods, and Events
    1. A.1. Properties
    2. A.2. Methods
    3. A.3. Events
    4. A.4. Event Sequences
      1. A.4.1. Mouse Events
      2. A.4.2. Resize Events
      3. A.4.3. Move Events
  13. B. Variable Declarations and Data Types
    1. B.1. Variable Declarations
    2. B.2. Initialization Expressions
    3. B.3. With
    4. B.4. Using
    5. B.5. Enumerated Type Declarations
    6. B.6. XML Variables
    7. B.7. Option Explicit and Option Strict
    8. B.8. Option Infer
    9. B.9. Data Types
    10. B.10. Data Type Characters
    11. B.11. Literal Type Characters
    12. B.12. Data Type Conversion Functions
    13. B.13. CType and DirectCast
  14. C. Operators
    1. C.1. Arithmetic Operators
    2. C.2. Concatenation Operators
    3. C.3. Comparison Operators
    4. C.4. Logical Operators
    5. C.5. Bitwise Operators
    6. C.6. Operator Precedence
    7. C.7. Assignment Operators
      1. C.7.1. Choose, If, and IIf
    8. C.8. Date and TimeSpan Operators
    9. C.9. Operator Overloading
  15. D. Subroutine and Function Declarations
    1. D.1. Subroutines
    2. D.2. Functions
    3. D.3. Property Procedures
    4. D.4. Lambda Functions
    5. D.5. Extension Methods
    6. D.6. Partial Methods
  16. E. Control Statements
    1. E.1. Decision Statements
      1. E.1.1. Single-Line If Then
      2. E.1.2. Multiline If Then
      3. E.1.3. Select Case
      4. E.1.4. If and IIf
      5. E.1.5. Choose
    2. E.2. Looping Statements
      1. E.2.1. For Next
      2. E.2.2. For Each
      3. E.2.3. Do Loop
      4. E.2.4. While End
    3. E.3. GoTo
  17. F. Error Handling
    1. F.1. Structured Error Handling
    2. F.2. Throwing Exceptions
    3. F.3. Classic Error Handling
  18. G. Windows Forms Controls and Components
    1. G.1. Components' Purposes
    2. G.2. Pointer
    3. G.3. BackgroundWorker
    4. G.4. BindingNavigator
    5. G.5. BindingSource
    6. G.6. Button
    7. G.7. CheckBox
    8. G.8. CheckedListBox
    9. G.9. ColorDialog
    10. G.10. ComboBox
    11. G.11. ContextMenuStrip
    12. G.12. DataGridView
    13. G.13. DataSet
    14. G.14. DateTimePicker
    15. G.15. DirectoryEntry
    16. G.16. DirectorySearcher
    17. G.17. DomainUpDown
    18. G.18. ErrorProvider
    19. G.19. EventLog
    20. G.20. FileSystemWatcher
    21. G.21. FlowLayoutPanel
    22. G.22. FolderBrowserDialog
    23. G.23. FontDialog
    24. G.24. GroupBox
    25. G.25. HelpProvider
    26. G.26. HScrollBar
    27. G.27. ImageList
    28. G.28. Label
    29. G.29. LinkLabel
    30. G.30. ListBox
    31. G.31. ListView
      1. G.31.1. ListView Helper Code
      2. G.31.2. Custom ListView Sorting
    32. G.32. MaskedTextBox
    33. G.33. MenuStrip
    34. G.34. MessageQueue
    35. G.35. MonthCalendar
    36. G.36. NotifyIcon
    37. G.37. NumericUpDown
    38. G.38. OpenFileDialog
    39. G.39. PageSetupDialog
    40. G.40. Panel
    41. G.41. PerformanceCounter
    42. G.42. PictureBox
    43. G.43. PrintDialog
    44. G.44. PrintDocument
    45. G.45. PrintPreviewControl
    46. G.46. PrintPreviewDialog
    47. G.47. Process
    48. G.48. ProgressBar
    49. G.49. PropertyGrid
    50. G.50. RadioButton
    51. G.51. ReportViewer
    52. G.52. RichTextBox
    53. G.53. SaveFileDialog
    54. G.54. SerialPort
    55. G.55. ServiceController
    56. G.56. SplitContainer
    57. G.57. Splitter
    58. G.58. StatusStrip
    59. G.59. TabControl
    60. G.60. TableLayoutPanel
    61. G.61. TextBox
    62. G.62. Timer
    63. G.63. ToolStrip
    64. G.64. ToolStripContainer
    65. G.65. ToolTip
    66. G.66. TrackBar
    67. G.67. TreeView
    68. G.68. VScrollBar
    69. G.69. WebBrowser
  19. H. WPF Controls
  20. I. Visual Basic Power Packs
    1. I.1. Microsoft Power Packs
      1. I.1.1. Interop Forms Toolkit
      2. I.1.2. Printer Compatibility Library
      3. I.1.3. PrintForm Component
      4. I.1.4. Line, OvalShape, and RectangleShape
    2. I.2. GotDotNet Power Pack
    3. I.3. Power Toys Pack Installer
  21. J. Form Objects
    1. J.1. Properties
    2. J.2. Methods
    3. J.3. Events
    4. J.4. Property-Changed Events
  22. K. Classes and Structures
    1. K.1. Classes
    2. K.2. Structures
    3. K.3. Constructors
    4. K.4. Events
  23. L. LINQ
    1. L.1. Basic LINQ Query Syntax
      1. L.1.1. From
      2. L.1.2. Where
      3. L.1.3. Order By
      4. L.1.4. Select
      5. L.1.5. Distinct
      6. L.1.6. Join
      7. L.1.7. Group By
      8. L.1.8. Limiting Results
    2. L.2. Using Query Results
    3. L.3. LINQ Functions
    4. L.4. LINQ to XML
      1. L.4.1. LINQ Into XML
      2. L.4.2. LINQ Out Of XML
    5. L.5. LINQ to DataSet
      1. L.5.1. Method-Based Queries
  24. M. Generics
    1. M.1. Generic Classes
    2. M.2. Generic Extensions
    3. M.3. Generic Methods
    4. M.4. Prohibited Generics
  25. N. Graphics
    1. N.1. Graphics Namespaces
      1. N.1.1. System.Drawing
      2. N.1.2. System.Drawing.Drawing2D
      3. N.1.3. System.Drawing.Imaging
      4. N.1.4. System.Drawing.Printing
    2. N.2. Drawing Classes
      1. N.2.1. Graphics
      2. N.2.2. Pen
      3. N.2.3. Brushes
      4. N.2.4. GraphicsPath
      5. N.2.5. StringFormat
      6. N.2.6. Image
      7. N.2.7. Bitmap
      8. N.2.8. Metafile
  26. O. Useful Exception Classes
    1. O.1. Standard Exception Classes
    2. O.2. Custom Exception Classes
  27. P. Date and Time Format Specifiers
    1. P.1. Standard Format Specifiers
    2. P.2. Custom Format Specifiers
  28. Q. Other Format Specifiers
    1. Q.1. Standard Numeric Format Specifiers
    2. Q.2. Custom Numeric Format Specifiers
    3. Q.3. Numeric Formatting Sections
    4. Q.4. Composite Formatting
    5. Q.5. Enumerated Type Formatting
  29. R. The Application Class
    1. R.1. Properties
    2. R.2. Methods
    3. R.3. Events
  30. S. The My Namespace
    1. S.1. My.Application
    2. S.2. My.Computer
      1. S.2.1. Audio
      2. S.2.2. Clipboard
      3. S.2.3. Clock
      4. S.2.4. FileSystem
      5. S.2.5. Info
      6. S.2.6. Keyboard
      7. S.2.7. Mouse
      8. S.2.8. Name
      9. S.2.9. Network
      10. S.2.10. Ports
      11. S.2.11. Registry
      12. S.2.12. Screen
    3. S.3. My.Forms
    4. S.4. My.Resources
    5. S.5. My.User
  31. T. Streams
    1. T.1. Stream Class Summary
    2. T.2. Stream
    3. T.3. BinaryReader and BinaryWriter
    4. T.4. TextReader and TextWriter
    5. T.5. StringReader and StringWriter
    6. T.6. StreamReader and StreamWriter
    7. T.7. Console Streams
    8. T.8. Text File Stream Methods
  32. U. File-System Classes
    1. U.1. Visual Basic Methods
    2. U.2. Framework Classes
      1. U.2.1. FileSystem
      2. U.2.2. Directory
      3. U.2.3. File
      4. U.2.4. DriveInfo
      5. U.2.5. DirectoryInfo
      6. U.2.6. FileInfo
      7. U.2.7. FileSystemWatcher
      8. U.2.8. Path
    3. U.3. My.Computer.FileSystem
    4. U.4. My.Computer.FileSystem.SpecialDirectories
  33. V. Index of Examples

Product information

  • Title: Visual Basic® 2008 Programmer's Reference
  • Author(s): Rod Stephens
  • Release date: February 2008
  • Publisher(s): Wrox
  • ISBN: 9780470182628