| |
| |
| |
Introduction to Visual Basic .NET 2005 | |
| |
| |
Writing Windows Applications with Visual Basic | |
| |
| |
The Windows Graphical User Interface | |
| |
| |
Programming Languages-Procedural, Event Driven, and Object Oriented | |
| |
| |
The Object Model | |
| |
| |
Microsoft's Visual Studio .NET | |
| |
| |
Writing Visual Basic Projects | |
| |
| |
The Three-Step Process | |
| |
| |
Visual Basic Application Files | |
| |
| |
The Visual Studio Environment | |
| |
| |
Default Environment Settings | |
| |
| |
The IDE Initial Screen | |
| |
| |
The New Project Dialog | |
| |
| |
The IDE Main Window | |
| |
| |
The Toolbars | |
| |
| |
The Document Window | |
| |
| |
The Form Designer | |
| |
| |
The Solution Explorer Window | |
| |
| |
The Properties Window | |
| |
| |
The Toolbox | |
| |
| |
Help | |
| |
| |
Design Time, Run Time, and Debug Time | |
| |
| |
Writing Your First Visual Basic Project | |
| |
| |
Set Up Your Workspace | |
| |
| |
Plan the Project | |
| |
| |
Define the User Interface | |
| |
| |
Set Properties | |
| |
| |
Write Code | |
| |
| |
Visual Basic Code Statements | |
| |
| |
Code the Event Procedures for Hello World | |
| |
| |
Run the Project | |
| |
| |
Save Your Work | |
| |
| |
Open the Project | |
| |
| |
Modify the Project | |
| |
| |
Print the Code | |
| |
| |
A Sample Printout | |
| |
| |
Finding and Fixing Errors | |
| |
| |
Syntax Errors | |
| |
| |
Run-Time Errors | |
| |
| |
Logic Errors | |
| |
| |
Project Debugging | |
| |
| |
Naming Rules and Conventions for Objects | |
| |
| |
Visual Studio Help | |
| |
| |
Installing and Running MSDN | |
| |
| |
Viewing Help Topics | |
| |
| |
Context-Sensitive Help | |
| |
| |
Managing Windows | |
| |
| |
| |
User Interface Design | |
| |
| |
Introducing More Controls | |
| |
| |
Text Boxes | |
| |
| |
Masked Text Boxes | |
| |
| |
Group Boxes | |
| |
| |
Check Boxes | |
| |
| |
Radio Buttons | |
| |
| |
Picture Boxes | |
| |
| |
Setting a Border and Style | |
| |
| |
Drawing a Line | |
| |
| |
Working with Multiple Controls | |
| |
| |
Selecting Multiple Controls | |
| |
| |
Deselecting a Group of Controls | |
| |
| |
Moving Controls as a Group | |
| |
| |
Setting Properties for Multiple Controls | |
| |
| |
Aligning Controls | |
| |
| |
Designing Your Applications for User Convenience | |
| |
| |
Designing the User Interface | |
| |
| |
Defining Keyboard Access Keys | |
| |
| |
Setting the Accept and Cancel Buttons | |
| |
| |
Setting the Tab Order for Controls | |
| |
| |
Setting the Form's Location on the Screen | |
| |
| |
Creating ToolTips | |
| |
| |
Coding for the Controls | |
| |
| |
Clearing Text Boxes and Labels | |
| |
| |
Resetting the Focus | |
| |
| |
Setting the Checked Property of Radio Buttons and Check Boxes | |
| |
| |
Setting Visibility at Run Time | |
| |
| |
Changing the Color of Text | |
| |
| |
Changing Multiple Properties of a Control | |
| |
| |
Concatenating Text | |
| |
| |
Continuing Long Program Lines | |
| |
| |
Your Hands-On Programming Example | |
| |
| |
Good Programming Habits | |
| |
| |
| |
Variables, Constants, and Calculations | |
| |
| |
Data-Variables and Constants | |
| |
| |
Data Types | |
| |
| |
Naming Rules | |
| |
| |
Naming Conventions | |
| |
| |
Constants: Named and Intrinsic | |
| |
| |
Declaring Variables | |
| |
| |
Scope and Lifetime of Variables | |
| |
| |
Calculations | |
| |
| |
Converting Strings to a Numeric Data Type | |
| |
| |
Arithmetic Operations | |
| |
| |
Order of Operations | |
| |
| |
Using Calculations in Code | |
| |
| |
Option Explicit and Option Strict | |
| |
| |
Converting between Numeric Data Types | |
| |
| |
Performing Calculations with Unlike Data Types | |
| |
| |
Rounding Numbers | |
| |
| |
Formatting Data for Display | |
| |
| |
Using Format Specifier Codes | |
| |
| |
Choosing the Controls for Program Output | |
| |
| |
A Calculation Programming Example | |
| |
| |
Planning the Project | |
| |
| |
The Project Coding Solution | |
| |
| |
Handling Exceptions | |
| |
| |
Try/Catch Blocks | |
| |
| |
Displaying Messages in Message Boxes | |
| |
| |
The TextMessage String | |
| |
| |
The Titlebar Text | |
| |
| |
MessageBoxButtons | |
| |
| |
MessageBoxIcon | |
| |
| |
Using Overloaded Methods | |
| |
| |
Testing Multiple Fields | |
| |
| |
Counting and Accumulating Sums | |
| |
| |
Summing Numbers | |
| |
| |
Counting | |
| |
| |
Calculating an Average | |
| |
| |
Your Hands-On Programming Example | |
| |
| |
| |
Decisions and Conditions | |
| |
| |
If Statements | |
| |
| |
Charting If Statements | |
| |
| |
The Helpful Editor | |
| |
| |
Conditions | |
| |
| |
Comparing Numeric Variables and Constants | |
| |
| |
Comparing Strings | |
| |
| |
Testing for True or False | |
| |
| |
Comparing Uppercase and Lowercase Characters | |
| |
| |
Compound Conditions | |
| |
| |
Short-Circuit Operations | |
| |
| |
Nested If Statements | |
| |
| |
Using If Statements with Radio Buttons and Check Boxes | |
| |
| |
A "Simple Sample" | |
| |
| |
Checking the State of a Radio Button Group | |
| |
| |
Checking the State of Multiple Check Boxes | |
| |
| |
Enhancing Message Boxes | |
| |
| |
Displaying the Message String | |
| |
| |
Displaying Multiple Buttons | |
| |
| |
Input Validation | |
| |
| |
Checking for a Range of Values | |
| |
| |
Checking for a Required Field | |
| |
| |
Performing Multiple Validations | |
| |
| |
Limiting User Actions by Disabling Controls | |
| |
| |
The Case Structure | |
| |
| |
Sharing an Event Procedure | |
| |
| |
Calling Event Procedures | |
| |
| |
Your Hands-On Programming Example | |
| |
| |
Debugging Visual Basic Projects | |
| |
| |
Writing Debug Output | |
| |
| |
Pausing Execution with the Break All Button | |
| |
| |
Forcing a Break | |
| |
| |
Checking the Current Values of Expressions | |
| |
| |
Stepping through Code | |
| |
| |
The Locals Window | |
| |
| |
The Autos Window | |
| |
| |
Debugging Step-by-Step Tutorial | |
| |
| |
| |
Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures | |
| |
| |
Menus | |
| |
| |
Defining Menus | |
| |
| |
Creating a Menu-Step-by-Step | |
| |
| |
Coding for Menu Items | |
| |
| |
Standards for Windows Menus | |
| |
| |
Common Dialog Boxes | |
| |
| |
Displaying a Windows Common Dialog Box | |
| |
| |
Using the Information from the Dialog Box | |
| |
| |
Setting Initial Values | |
| |
| |
Creating Context Menus | |
| |
| |
Creating a Context Menu-Step-by-Step | |
| |
| |
Sharing Procedures | |
| |
| |
Writing General Procedures | |
| |
| |
Creating a New Sub Procedure | |
| |
| |
Passing Arguments to Procedures | |
| |
| |
Writing Function Procedures | |
| |
| |
Functions with Multiple Arguments | |
| |
| |
Breaking Calculations into Smaller Units | |
| |
| |
Basing a New Project on an Existing Project | |
| |
| |
Your Hands-On Programming Example | |
| |
| |
| |
Multiform Projects | |
| |
| |
Using Multiple Forms | |
| |
| |
Creating New Forms | |
| |
| |
Adding and Removing Forms | |
| |
| |
An About Box | |
| |
| |
Using the About Box Template | |
| |
| |
Setting Assembly Information | |
| |
| |
A Splash Screen | |
| |
| |
Using the Splash Screen Template | |
| |
| |
Making the Splash Form Display First | |
| |
| |
Other Template Forms | |
| |
| |
Using the Methods and Events of Forms | |
| |
| |
Showing a Form | |
| |
| |
Hiding or Closing a Form | |
| |
| |
Responding to Form Events | |
| |
| |
The Sequence of Form Events | |
| |
| |
Writing Event Procedures for Selected Events | |
| |
| |
Holding the Splash Screen Display | |
| |
| |
Variables and Constants in Multiform Projects | |
| |
| |
Scope | |
| |
| |
Access Level | |
| |
| |
Lifetime | |
| |
| |
Namespaces | |
| |
| |
Declaration Summary for Variables and Constants | |
| |
| |
Guidelines for Declaring Variables and Constants | |
| |
| |
Running Your Program Outside the IDE | |
| |
| |
Your Hands-On Programming Example | |
| |
| |
| |
Lists, Loops, and Printing | |
| |
| |
List Boxes and Combo Boxes | |
| |
| |
The Items Collection | |
| |
| |
Filling a List | |
| |
| |
The SelectedIndex Property | |
| |
| |
The Items.Count Property | |
| |
| |
Referencing the Items Collection | |
| |
| |
Removing an Item from a List | |
| |
| |
Clearing a List | |
| |
| |
List Box and Combo Box Events | |
| |
| |
Do/Loops | |
| |
| |
The Boolean Data Type Revisited | |
| |
| |
Using a Do/Loop with a List Box | |
| |
| |
For/Next Loops | |
| |
| |
Negative Increment or Counting Backward | |
| |
| |
Conditions Satisfied before Entry | |
| |
| |
Altering the Values of the Loop Control Variables | |
| |
| |
Endless Loops | |
| |
| |
Exiting Loops | |
| |
| |
Skipping to the Next Iteration of a Loop | |
| |
| |
Making Entries Appear Selected | |
| |
| |
Selecting the Entry in a Text Box | |
| |
| |
Selecting an Entry in a List Box | |
| |
| |
Sending Information to the Printer | |
| |
| |
The PrintDocument Component | |
| |
| |
Printing the Contents of a List Box | |
| |
| |
Printing the Selected Item from a List | |
| |
| |
Aligning Decimal Columns | |
| |
| |
Displaying a Print Preview | |
| |
| |
The Using Block | |
| |
| |
Printing Multiple Pages | |
| |
| |
Your Hands-On Programming Example | |
| |
| |
| |
Arrays | |
| |
| |
Single-Dimension Arrays | |
| |
| |
Subscripts | |
| |
| |
Valid Subscripts | |
| |
| |
For Each/Next Statements | |
| |
| |
Structures | |
| |
| |
Declaring Variables Based on a Structure | |
| |
| |
Accessing the Elements in a Structure Variable | |
| |
| |
Including an Array in a Structure | |
| |
| |
Using Array Elements for Accumulators | |
| |
| |
Adding to the Correct Total | |
| |
| |
Debugging Array Programs | |
| |
| |
Table Lookup | |
| |
| |
Coding a Table Lookup | |
| |
| |
Using List Boxes with Arrays | |
| |
| |
Multidimensional Arrays | |
| |
| |
Initializing Two-Dimensional Arrays | |
| |
| |
Printing a Two-Dimensional Table | |
| |
| |
Summing a Two-Dimensional Table | |
| |
| |
Lookup Operation for Two-Dimensional Tables | |
| |
| |
Your Hands-On Programming Example | |
| |
| |
| |
Programming with Visual Web Developer | |
| |
| |
Visual Basic and Web Programming | |
| |
| |
Client/Server Web Applications | |
| |
| |
Types of Web Sites | |
| |
| |
File System Web Sites | |
| |
| |
IIS Web Sites | |
| |
| |
Remote Sites and FTP Sites | |
| |
| |
Creating a Web Site | |
| |
| |
Web Page Files | |
| |
| |
Web Forms in the Visual Studio IDE | |
| |
| |
Creating Your First Web Form-Step-by-Step | |
| |
| |
Viewing the HTML Code | |
| |
| |
Controls | |
| |
| |
Event Handling | |
| |
| |
Files | |
| |
| |
Debugging | |
| |
| |
Testing in Other Browsers | |
| |
| |
Laying Out Web Forms | |
| |
| |
Using Tables for Layout | |
| |
| |
Including Images on Web Pages | |
| |
| |
Navigating Web Pages | |
| |
| |
Using Hyperlinks | |
| |
| |
Adding a Second Web Page | |
| |
| |
Using the Validator Controls | |
| |
| |
Maintaining State | |
| |
| |
Retaining the Contents of Controls | |
| |
| |
Retaining the Values of Variables | |
| |
| |
Managing Web Projects | |
| |
| |
Using the Copy Web Site Tool | |
| |
| |
Some Web Acronyms | |
| |
| |
Your Hands-On Programming Example | |
| |
| |
| |
Accessing Database Files | |
| |
| |
Database Files | |
| |
| |
Visual Basic and Database Files | |
| |
| |
Database Terminology | |
| |
| |
XML Data | |
| |
| |
Using ADO.NET and Visual Basic | |
| |
| |
Data Access in Visual Studio 2005 | |
| |
| |
Binding Sources | |
| |
| |
Table Adapters | |
| |
| |
Datasets | |
| |
| |
Creating a Database Application | |
| |
| |
A Windows Database Application-Step-By-Step | |
| |
| |
The Smart Tag | |
| |
| |
The Database Schema File | |
| |
| |
Binding Individual Data Fields | |
| |
| |
The Data Sources Window | |
| |
| |
Database Details Program-Step-By-Step | |
| |
| |
Selecting Records from a List | |
| |
| |
Converting to Combo Box Selection-Step-By-Step | |
| |
| |
Selecting Fields from the Table | |
| |
| |
Sorting the List Data | |
| |
| |
Choosing the Control Type for Fields | |
| |
| |
Selecting Records Using Web Forms | |
| |
| |
Security in Web Database Applications | |
| |
| |
Creating the Web Selection Application-Step-by-Step | |
| |
| |
Moving Database Projects | |
| |
| |
Your Hands-On Programming Example | |
| |
| |
| |
Saving Data in Files | |
| |
| |
Creating Objects | |
| |
| |
Declaring an Object Variable | |
| |
| |
Instantiating an Object | |
| |
| |
Data Files | |
| |
| |
Data Files and Project Files | |
| |
| |
Data File Terminology | |
| |
| |
File Handling Using Streams | |
| |
| |
Writing Data in a File | |
| |
| |
Reading Data from a File | |
| |
| |
Using the File Common Dialog Box | |
| |
| |
OpenFileDialog Component Properties | |
| |
| |
Displaying the Open File Dialog Box | |
| |
| |
The Open and Write File Program | |
| |
| |
Saving the Contents of a List Box | |
| |
| |
Loading the List Box | |
| |
| |
Checking for Existence of the File | |
| |
| |
Saving the File | |
| |
| |
Querying the User to Save | |
| |
| |
The FormClosing Event Procedure | |
| |
| |
Your Hands-On Programming Example | |
| |
| |
| |
OOP: Creating Object-Oriented Programs | |
| |
| |
Object-Oriented Programming | |
| |
| |
Objects | |
| |
| |
Object-Oriented Terminology | |
| |
| |
Reusable Classes | |
| |
| |
Multitier Applications | |
| |
| |
Classes | |
| |
| |
Designing Your Own Class | |
| |
| |
Creating Properties in a Class | |
| |
| |
Class Methods | |
| |
| |
Constructors and Destructors | |
| |
| |
Creating a New Class-Step-by-Step | |
| |
| |
Property Procedures with Mixed Access Levels | |
| |
| |
Creating a New Object Using a Class | |
| |
| |
Defining and Using a New Object-Step-by-Step | |
| |
| |
Instance Variables versus Shared Variables | |
| |
| |
Adding Shared Properties to the Step-by-Step Exercise | |
| |
| |
Destructors | |
| |
| |
Garbage Collection | |
| |
| |
Inheritance | |
| |
| |
Inheriting Properties and Methods | |
| |
| |
Constructors in Inheritance | |
| |
| |
Overriding Methods | |
| |
| |
Accessing Properties | |
| |
| |
Creating a Derived Class Based on BookSale | |
| |
| |
Adding Inheritance to the Step-by-Step Exercise | |
| |
| |
Creating a Base Class Strictly for Inheritance | |
| |
| |
Inheriting Form Classes | |
| |
| |
Managing Multiclass Projects | |
| |
| |
Adding an Existing Class File to a Project | |
| |
| |
Using the Object Browser | |
| |
| |
Examining VB Classes | |
| |
| |
Examining Your Own Classes | |
| |
| |
Your Hands-On Programming Example | |
| |
| |
| |
Graphics, Animation, Sound, and Drag-and-Drop | |
| |
| |
Graphics in Windows and the Web | |
| |
| |
The Graphics Environment | |
| |
| |
Steps for Drawing Graphics | |
| |
| |
The Paint Event Procedure | |
| |
| |
Pen and Brush Objects | |
| |
| |
The Coordinate System | |
| |
| |
Graphics Methods | |
| |
| |
Random Numbers | |
| |
| |
Simple Animation | |
| |
| |
Displaying an Animated Graphic | |
| |
| |
Controlling Pictures at Run Time | |
| |
| |
Moving a Picture | |
| |
| |
The Timer Component | |
| |
| |
The Scroll Bar Controls | |
| |
| |
Scroll Bar Properties | |
| |
| |
Scroll Bar Events | |
| |
| |
A Programming Example | |
| |
| |
Playing Sounds | |
| |
| |
Adding Sound Files to the Resources for a Project | |
| |
| |
A Sound-Playing Program | |
| |
| |
Drag-and-Drop Programming | |
| |
| |
The Source Object | |
| |
| |
The Target Object | |
| |
| |
The Drag-and-Drop Program | |
| |
| |
Your Hands-On Programming Example | |
| |
| |
| |
Additional Topics in Visual Basic | |
| |
| |
Advanced Validation Techniques | |
| |
| |
The ErrorProvider Component | |
| |
| |
The MaxLength and CharacterCasing Properties | |
| |
| |
Field-Level Validation | |
| |
| |
Capturing Keystrokes from the User | |
| |
| |
Using the Masked Text Box for Validation | |
| |
| |
Code Snippets and Samples | |
| |
| |
Code Snippets | |
| |
| |
Sample Projects | |
| |
| |
Multiple Document Interface | |
| |
| |
Creating an MDI Project | |
| |
| |
Adding a Window Menu | |
| |
| |
Toolbars and Status Bars | |
| |
| |
Toolbars | |
| |
| |
Status Bars | |
| |
| |
Some Helpful Date Controls | |
| |
| |
The Calendar Controls | |
| |
| |
Displaying Web Pages on a Windows Form | |
| |
| |
The WebBrowser Control | |
| |
| |
A WebBrowser Program | |
| |
| |
Checking for the Enter Key | |
| |
| |
| |
Answers to Feedback Questions | |
| |
| |
| |
Methods and Functions for Working with Dates, Financial Calculations, Mathematics, and String Operations | |
| |
| |
Working with Dates | |
| |
| |
The DateTime Structure | |
| |
| |
Retrieving the System Date and Time | |
| |
| |
Date Variables | |
| |
| |
Converting Values to a Date Format | |
| |
| |
Finding the Difference between Dates | |
| |
| |
Checking for the Day of the Week | |
| |
| |
Financial Functions | |
| |
| |
The Pmt Function | |
| |
| |
The Rate Function | |
| |
| |
Functions to Calculate Depreciation | |
| |
| |
Mathematical Functions | |
| |
| |
Working with Strings | |
| |
| |
Methods for Conversion between Data Types | |
| |
| |
Functions for Checking Validity | |
| |
| |
Functions for Formatting Output | |
| |
| |
| |
Tips and Shortcuts for Mastering the Environment | |
| |
| |
Set Up the Screen for Your Convenience | |
| |
| |
Close or Hide Extra Windows | |
| |
| |
Use the Full Screen | |
| |
| |
Modify the Screen Layout | |
| |
| |
Split the Screen Vertically | |
| |
| |
Reset the IDE Layout | |
| |
| |
Set Options for Your Work | |
| |
| |
Use Shortcuts in the Form Designer | |
| |
| |
Use the Layout Toolbar | |
| |
| |
Nudge Controls into Place | |
| |
| |
Use Snap Lines to Help Align Controls | |
| |
| |
Use Shortcuts in the Editor | |
| |
| |
Use the Text Editor Toolbar | |
| |
| |
Use Keyboard Shortcuts When Editing Code | |
| |
| |
Split the Editor Window | |
| |
| |
Use Drag-and-Drop Editing | |
| |
| |
Drag Commonly Used Code to the Toolbox | |
| |
| |
Rename Variables and Objects | |
| |
| |
Use Context-Sensitive Help | |
| |
| |
Copy and Move Projects | |
| |
| |
Copy and Move a Project | |
| |
| |
Deploy Applications | |
| |
| |
| |
.NET Security | |
| |
| |
Authentication and Authorization | |
| |
| |
IIS Authentication | |
| |
| |
Authorization and Impersonation | |
| |
| |
Writing Secure Code | |
| |
| |
SQL Injection | |
| |
| |
Error Messages | |
| |
| |
Code Access Security | |
| |
| |
Glossary | |
| |
| |
Index 616 | |