| |
| |
Acknowledgments | |
| |
| |
Introduction | |
| |
| |
| |
Getting Started with Your First Windows Program | |
| |
| |
Obtaining and Installing Visual C# 2005 | |
| |
| |
System Requirements | |
| |
| |
Choosing the Right Version | |
| |
| |
Installing Visual C# 2005 | |
| |
| |
Starting Your First Visual C# 2005 Project | |
| |
| |
Starting the Program | |
| |
| |
Specifying the Type of New Project | |
| |
| |
Specifying the Name and Location of the Project | |
| |
| |
Integrated Development Environment (IDE) | |
| |
| |
Run the Project! | |
| |
| |
What Is a Computer Program? | |
| |
| |
What Is a Programming Language? | |
| |
| |
Translating the Code for the Computer | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Writing Your First Code | |
| |
| |
Starting an Existing Project | |
| |
| |
Design View and Code View | |
| |
| |
Object Browser | |
| |
| |
Classes and Objects | |
| |
| |
Inherits | |
| |
| |
Namespaces | |
| |
| |
.NET Framework | |
| |
| |
Properties | |
| |
| |
Properties Window | |
| |
| |
Changing Properties at Design Time | |
| |
| |
What Is a Windows Application? | |
| |
| |
Windows Applications Are Gooey | |
| |
| |
Windows Applications Are Event-Driven | |
| |
| |
Classes Have Events | |
| |
| |
Creating an Event Procedure | |
| |
| |
Creating an Event Procedure Stub | |
| |
| |
Writing Code Inside the Event Procedure | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Controls | |
| |
| |
Adding Controls to the Form | |
| |
| |
Toolbox | |
| |
| |
Copying a Control from the Toolbox to the Form | |
| |
| |
Changing the Control's Location | |
| |
| |
Changing the Control's Size | |
| |
| |
Important Label Properties | |
| |
| |
Text Property | |
| |
| |
Name Property | |
| |
| |
The Label Control in Action | |
| |
| |
Mouse Coordinates | |
| |
| |
Creating the Application | |
| |
| |
How the Code Works | |
| |
| |
Using Event Procedure Parameters | |
| |
| |
What If You Type the Wrong Code? | |
| |
| |
ToString Method | |
| |
| |
Delegate | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Storing Information-Data Types and Variables | |
| |
| |
Data Types | |
| |
| |
Numeric Data Types | |
| |
| |
Text Data Types | |
| |
| |
Data Types of Visual C# Properties | |
| |
| |
Variables | |
| |
| |
Declaring a Variable | |
| |
| |
Where Do I Declare a Variable? | |
| |
| |
Constants | |
| |
| |
Declaring a Constant | |
| |
| |
Why Use Constants? | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Letting the Program Do the Math-Arithmetic Operators | |
| |
| |
Arithmetic Operators | |
| |
| |
The Addition Operator | |
| |
| |
The Subtraction Operator | |
| |
| |
The Multiplication Operator | |
| |
| |
The Division Operators | |
| |
| |
Operator Precedence | |
| |
| |
Combining Arithmetic and Assignment Operators | |
| |
| |
Increment and Decrement Operators | |
| |
| |
The Parse Method | |
| |
| |
Class Methods | |
| |
| |
Change Machine Project | |
| |
| |
Creating the Project | |
| |
| |
The Algorithm | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Making Comparisons-Comparison and Logical Operators | |
| |
| |
Debugging | |
| |
| |
Comparison Operators | |
| |
| |
Numeric Comparison Operators | |
| |
| |
String Comparisons | |
| |
| |
Precedence | |
| |
| |
Logical Operators | |
| |
| |
The && Operator | |
| |
| |
The & Operator | |
| |
| |
The [double vertical line] Operator | |
| |
| |
The [vertical bar] Operator | |
| |
| |
The ^ Operator | |
| |
| |
The ! Operator | |
| |
| |
Precedence | |
| |
| |
Why && and [double vertical line] in Addition to & and [vertical bar]? | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Making Choices-if and switch Control Structures | |
| |
| |
Creating a Test Project | |
| |
| |
The if Control Structure | |
| |
| |
The if Statement | |
| |
| |
The if ... else Statement | |
| |
| |
The if ... else if Statement | |
| |
| |
Input Validation | |
| |
| |
Exceptions | |
| |
| |
Controls Used for the if Control Structure | |
| |
| |
CheckBox Control | |
| |
| |
RadioButton Control | |
| |
| |
Pizza Calculator | |
| |
| |
Creating the Project | |
| |
| |
How the Project Works | |
| |
| |
The Code | |
| |
| |
The switch Control Structure | |
| |
| |
Syntax | |
| |
| |
The switch Control Structure in Action | |
| |
| |
The break Keyword | |
| |
| |
Choosing Between if ... else if and switch | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Repeating Yourself-Loops and Arrays | |
| |
| |
Loops | |
| |
| |
The for Statement | |
| |
| |
The continue Keyword | |
| |
| |
The foreach Statement | |
| |
| |
The while Statement | |
| |
| |
The do while construct | |
| |
| |
Arrays | |
| |
| |
Declaring Arrays | |
| |
| |
Assigning Values to the Array | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Organizing Your Code with Methods | |
| |
| |
Defining and Calling a Method | |
| |
| |
Terminology of a Method | |
| |
| |
Naming a Method | |
| |
| |
Defining a Method | |
| |
| |
Calling a Method | |
| |
| |
Parameters-Sending Information to a Method | |
| |
| |
Passing Arguments by Value | |
| |
| |
Passing Arguments by Reference | |
| |
| |
Returning a Value from a Method | |
| |
| |
Syntax | |
| |
| |
How the Value Is Returned | |
| |
| |
Saving the Return Value | |
| |
| |
Returning a Boolean Value | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Helper Forms | |
| |
| |
Message Boxes | |
| |
| |
Creating the Project | |
| |
| |
Message Boxes Are Modal | |
| |
| |
Show Method | |
| |
| |
Using the Show Method's Return Value | |
| |
| |
Dialog Forms | |
| |
| |
Creating the Project | |
| |
| |
Showing the Dialog Form and Returning Its Result | |
| |
| |
Accessing Values from the Dialog Form | |
| |
| |
Modal vs. Modeless | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Menus | |
| |
| |
Creating a Main Menu | |
| |
| |
Adding a MenuStrip Control to a Form | |
| |
| |
Adding Menu Items to the MenuStrip | |
| |
| |
Enhancing the Menu Items | |
| |
| |
Adding Functionality to the Menu Items | |
| |
| |
Disabling Menu Items | |
| |
| |
Creating a Context Menu | |
| |
| |
Adding a ContextMenuStrip to a Form | |
| |
| |
Adding Menu Items to the ContextMenuStrip | |
| |
| |
Adding Functionality to Context Menu Items | |
| |
| |
Text Editor Project | |
| |
| |
Creating the Project | |
| |
| |
Explanation of the Code | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Toolbars | |
| |
| |
Creating a Toolbar | |
| |
| |
Adding a Toolbar to a Form | |
| |
| |
Adding Buttons to the Toolbar | |
| |
| |
Associating Images with Toolbar Buttons | |
| |
| |
Associating Code with Clicks of Toolbar Buttons | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Accessing Text Files | |
| |
| |
Open and Save File Dialog Boxes | |
| |
| |
Adding an OpenFileDialog Control to Your Form | |
| |
| |
Showing the OpenFileDialog Control | |
| |
| |
Determining Whether Open or Cancel Is Chosen | |
| |
| |
Identifying the File to Open | |
| |
| |
SaveFileDialog Class | |
| |
| |
Reading from a Text File | |
| |
| |
StreamReader Class | |
| |
| |
Reading the Text File into the TextBox | |
| |
| |
Closing the Text File | |
| |
| |
Writing to a Text File | |
| |
| |
StreamWriter Class | |
| |
| |
Writing from the TextBox to the Text File | |
| |
| |
Closing the Text File | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Databases | |
| |
| |
Installing the Database | |
| |
| |
Obtaining the Northwind Traders Database | |
| |
| |
Installing the Northwind Traders Database | |
| |
| |
Connecting to the Database | |
| |
| |
Using Server Explorer | |
| |
| |
Exploring the Database | |
| |
| |
Exploring the Customers Table | |
| |
| |
Database Project | |
| |
| |
What the Project Does | |
| |
| |
Creating the Form | |
| |
| |
Importing Data Namespaces | |
| |
| |
Creating a Connection | |
| |
| |
Creating a Command | |
| |
| |
Filling the DataGridView | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
| |
Web Applications | |
| |
| |
ASP.NET | |
| |
| |
Internet Information Services | |
| |
| |
Determining If IIS Is Already Installed | |
| |
| |
Installing IIS | |
| |
| |
Starting the IIS Admin Service | |
| |
| |
Starting the Default Website | |
| |
| |
URL | |
| |
| |
Your Computer as the Web Server | |
| |
| |
Virtual and Physical Paths | |
| |
| |
Creating a Web Application | |
| |
| |
ASP.NET Development Server | |
| |
| |
ASP.NET Application IDE | |
| |
| |
Creating a Database Web Application | |
| |
| |
Adding a GridView Control | |
| |
| |
Locating the Database on the Web Server | |
| |
| |
Adding Code | |
| |
| |
Conclusion | |
| |
| |
Quiz | |
| |
| |
Final Exam | |
| |
| |
Answers | |
| |
| |
Index | |