Skip to main content

Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer

Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer

Rod Stephens

ISBN: 978-0-470-59690-6

May 2010

552 pages

Select type: Paperback


Product not available for purchase


A unique book-and-DVD package from preeminent programming instructor Rod Stephens

Visual C# has become a leading programming language, resulting in greater career opportunities for Visual C# programmers. This Wrox guide literally shows novice programmers how to program in C# with Microsoft Visual Studio, using both written and visual instruction.

Easy-to-follow lessons reinforced with step-by-step instructions, screencasts, and supplemental exercises make it easy to master Visual C# programming regardless of your learning style. Each lesson begins with a discussion of a concept or technique and proceeds through step-by-step directions for using the technique Visual C# has surpassed Visual Basic as the most popular programming language

Coverage Includes:

  • Getting Started with the Visual Studio IDE
  • Creating Controls
  • Making Controls Arrange Themselves
  • Handling Events
  • Making Menus
  • Making Tool Strips and Status Strips
  • Using RichTextBoxes
  • Using Standard Dialogs
  • Creating and Displaying New Forms
  • Building Custom Dialogs
  • Using Variables and Performing Calculations
  • Debugging Code
  • Understanding Scope
  • Working with Strings
  • Working with Dates and Times
  • Using Arrays and Collections
  • Using Enumerations and Structures
  • Making Choices
  • Repeating Program Steps
  • Handling Errors
  • Preventing Bugs
  • Defining Classes
  • Initializing Objects
  • Fine-Tuning Classes
  • Overloading Operators
  • Using Interfaces
  • Making Generic Classes
  • Reading and Writing Files
  • Using File System Classes
  • Printing
  • Using the Clipboard
  • Providing Drag and Drop
  • Localizing Programs
  • Programming Databases
  • LINQ to Objects
  • LINQ to SQL
  • Drawing with GDI+
  • Making WPF Applications
  • Printing with WPF

Note: As part of the print version of this title, video lessons are included on DVD. For e-book versions, video lessons can be accessed at using a link provided in the interior of the e-book.

Introduction xxv

Section I: The Visual Studio IDE and Controls

Lesson 1: Getting Started with the Visual Studio IDE 3

Lesson 2: Creating Controls 19

Lesson 3: Making Controls Arrange Themselves 37

Lesson 4: Handling Events 47

Lesson 5: Making Menus 57

Lesson 6: Making Tool Strips and Status Strips 67

Lesson 7: Using RichTextBoxes 79

Lesson 8: Using Standard Dialogs 89

Lesson 9: Creating and Displaying New Forms 103

Lesson 10: Building Custom Dialogs 115

Section II : Variables and Calculations

Lesson 11: Using Variables and Performing Calculations 127

Lesson 12: Debugging Code 151

Lesson 13: Understanding Scope 163

Lesson 14: Working with Strings 175

Lesson 15: Working with Dates and Times 187

Lesson 16: Using Arrays and Collections 195

Lesson 17: Using Enumerations and Structures 209

Section III : Program Statements

Lesson 18: Making Choices 219

Lesson 19: Repeating Program Steps 229

Lesson 20: Reusing Code with Methods 241

Lesson 21: Handling Errors 251

Lesson 22: Preventing Bugs 259

Section IV: Classes

Lesson 23: Defining Classes 269

Lesson 24: Initializing Objects 289

Lesson 25: Fine-Tuning Classes 301

Lesson 26: Overloading Operators 311

Lesson 27: Using Interfaces 319

Lesson 28: Making Generic Classes 331

Section V: System Interactions

Lesson 29: Reading and Writing Files 343

Lesson 30: Using File System Classes 349

Lesson 31: Printing 359

Lesson 32: Using the Clipboard 369

Lesson 33: Providing Drag and Drop 377

Section VI: Specialized Topics

Lesson 34: Localizing Programs 387

Lesson 35: Programming Databases, Part 1 395

Lesson 36: Programming Databases, Part 2 405

Lesson 37: LIN Q to Objects 411

Lesson 38: LIN Q to SQL 423

Lesson 39: Drawing with GDI + 437

Lesson 40: Making WP F Applications 449

Lesson 41: Printing with WP F 461

Appendix A: Glossary 469

Appendix B: Control Summary 477

Appendix C: What’s on the DVD? 483

Index 487

Downloads for Stephens' C# Programming 24-Hour Trainer
ChapterPageDetailsDatePrint Run
5Error in Text
Page 5, Fig. 1-1: You may see only the Basic and Expert choices for importing and exporting choices. Other settings are available for different versions of Visual Studio.

6Error in Text
Fig. 1-2 should include text reading:
When you create a new project, the Location and Solution Name boxes are not present. You'll see them when you first save the project.

Author Rod Stephens suggested our posting something to this effect on the title page for this book at Wrox per the customer's suggestion:
Kenn Macintosh suggested adding this comment to Chapter 1: "If you have mutliple monitors, you can FLOAT a window and move them to other Monitors giving you a larger editing area". An excellent suggestion, Kenn! I only have one monitor but I work with some people who use two and they move forms that are used less often to the second monitor so they can have more space for their main task.

17Error in Text
Exercise 3 should include additional information reading:
By default the Immediate window is hidden in the Express edition. However, it is useful so it's worth tracking down. One way to display it is to open the menu View > Other Windows > Command Window. Then in the Command Window type "immed" and press Enter.

44Error in Text
Exercise 3 should include the following additional text:

Selecting the SpointContainer itself it a bit tricky. If you click on one of the control's panels, you select the panel and not the main control. You can select the control in any of these ways:
Use the control dropdown in the Properties window.
Click between the two panels.
Click and drag on the form so the drag touches the control.

53Error in Text
The names used by the controls should read:


62Error in Text
In the Try It section:

Currently reads: txtContents

Should read: contentsTextBox

63Error in Text
Step 2 in the middle of the pages explains how to use copy and paste to copy the main menu's Format menu structure into a context menu. Some readers have found that Visual Studio did not let them copy multiple menu items at the same time, although it did let them copy items one at a time.

198Error in Code
The code that creates a two-dimensional array currently reads:

int[,] values = new int[5, 7];

It should read:

int[,] values = new int[5, 8];

Note that the array shown in Figure 16-3 would be declared by using the following code:

int[,] values = new int[4, 8];