Sams Teach Yourself Visual C# 2008 in 24 Hours: Complete Starter Kit (Sams Teach Yourself -- Hours Series)


Sams Teach Yourself Visual C#® 2008 in 24 Hours

James Foxall

Starter Kit

DVD includes Visual C#® 2008 Express Edition

In just 24 sessions of one hour or less, you will be up and running with Visual C# 2008. Using a straightforward, step-by-step approach, each lesson builds...

See more details below
$26.41 price
(Save 24%)$34.99 List Price
Other sellers (Paperback)
  • All (17) from $1.99   
  • New (4) from $25.30   
  • Used (13) from $1.99   
Sending request ...


Sams Teach Yourself Visual C#® 2008 in 24 Hours

James Foxall

Starter Kit

DVD includes Visual C#® 2008 Express Edition

In just 24 sessions of one hour or less, you will be up and running with Visual C# 2008. Using a straightforward, step-by-step approach, each lesson builds upon the previous one, allowing you to learn the essentials of Visual C# from the ground up.

By the Way notes present interesting pieces of information.

Did You Know? tips offer advice or teach an easier way to do something.

Watch Out! cautions advise you about potential problems and help you steer clear of disaster.

Learn how to...

  • Use the powerful design environment of Visual Studio 2008
  • Design a feature-rich interface using components such as tree views and tabs
  • Create robust applications using modern error handling
  • Draw fast graphics using GDI+
  • Build a database application using ADO.NET
  • Distribute a Visual C# 2008 application

James Foxall is vice president of Tigerpaw Software, Inc. (, a Bellevue, Nebraska, Microsoft Certified Partner specializing in commercial database applications. He manages the development, support, training, and education of Tigerpaw CRM+, an award-winning application that automates contact management, marketing, service and repair, proposal generation, inventory control, and purchasing. Tigerpaw has more than 20,000 licensed users in 27 countries. Foxall’s experience in creating certified Office-compatible software has made him an authority on application interface and behavior standards. In addition to being a well-known author, James is an international speaker on Microsoft technologies, has taught at the college level, and contributes to several journals.

DVD Includes:

  • Microsoft® Visual C#® 2008 Express Edition

On the Web:

  • Register your book at for access to author code, examples, updates and corrections as they become available.

Category: Microsoft Programming

Covers: Visual C# 2008

User Level: Beginning

Read More Show Less

Product Details

  • ISBN-13: 9780672329906
  • Publisher: Sams
  • Publication date: 8/8/2008
  • Series: Sams Teach Yourself Series
  • Pages: 512
  • Product dimensions: 6.98 (w) x 9.00 (h) x 1.22 (d)

Meet the Author

James Foxall is vice president of Tigerpaw Software, Inc. (, a Bellevue, Nebraska, Microsoft Certified Partner specializing in commercial database applications. He manages the development, support, training, and education of Tigerpaw CRM+, an award-winning CRM product designed to automate contact management, marketing, service and repair, proposal generation, inventory control, and purchasing. At the start of 2008, the current release of Tigerpaw CRM+ had more than 16,000 licensed users. Foxall’s experience in creating certified Office-compatible software has made him an authority on application interface and behavior standards of applications for the Microsoft Windows and Microsoft Office environments.

Foxall has been writing commercial product code for more than 14 years, in both singleprogrammer and multiple-programmer environments. He’s the author of numerous books, including Practical Standards for Microsoft Visual Basicand MCSD in a Nutshell: The Visual Basic Exams. He also has written articles for Access-Office-VBA Advisorand Visual Basic Programmer’s Journal. Foxall has a bachelor’s degree in management of information systems (MIS). He is a Microsoft Certified Solution Developer and an international speaker on Microsoft Visual Basic. When not programming or writing about programming, he enjoys spending time with his family, playing guitar, listening to amazing bands like Pink Floyd and OSI, and playing computer games. You can reach him at

Read More Show Less

Table of Contents


Part I: The Visual C# 2008 Environment

HOUR 1: Jumping In with Both Feet: A Visual C# 2008 Programming Tour

Starting Visual C# 2008

Creating a New Project

Understanding the Visual Studio .NET Environment

Changing the Characteristics of Objects

Adding Controls to a Form

Designing an Interface

Writing the Code Behind an Interface

Running a Project




HOUR 2: Navigating Visual C# 2008

Using the Visual C# 2008 Start Page

Navigating and Customizing the Visual C# Environment

Working with Toolbars

Adding Controls to a Form Using the Toolbox

Setting Object Properties Using the Properties Window

Managing Projects

A Quick-and-Dirty Programming Primer

Getting Help




HOUR 3: Understanding Objects and Collections

Understanding Objects

Understanding Properties

Understanding Methods

Building a Simple Object Example Project

Understanding Collections

Using the Object Browser




HOUR 4: Understanding Events

Understanding Event-Driven Programming

Building an Event Example Project




Part II: Building a User Interface

HOUR 5: Building Forms—The Basics

Changing a Form’s Name

Changing a Form’s Appearance

Showing and Hiding Forms




HOUR 6: Building Forms—Advanced Techniques

Working with Controls

Adding a Control by Double-Clicking It in the Toolbox

Adding a Control by Dragging from the Toolbox

Adding a Control by Drawing It

Creating Topmost Nonmodal Windows

Creating Transparent Forms

Creating Scrollable Forms

Creating MDI Forms




HOUR 7: Working with Traditional Controls

Displaying Static Text with the Label Control

Allowing Users to Enter Text Using a Text Box

Creating Buttons

Presenting Yes/No Options Using Check Boxes

Creating Containers and Groups of Option Buttons

Displaying a List with the List Box

Creating Drop-Down Lists Using the Combo Box




HOUR 8: Using Advanced Controls

Creating Timers

Creating Tabbed Dialog Boxes

Storing Pictures in an Image List

Building Enhanced Lists Using the List View

Creating Hierarchical Lists with the Tree View




HOUR 9: Adding Menus and Toolbars to Forms

Building Menus

Using the Toolbar Control

Creating a Status Bar




Part III: Making Things Happen: Programming

HOUR 10: Creating and Calling Methods

Understanding Class Members

Defining and Writing Methods

Calling Methods

Exiting Methods

Creating Static Methods

Avoiding Infinite Recursion




HOUR 11: Using Constants, Data Types, Variables, and Arrays

Understanding Data Types

Defining and Using Constants

Declaring and Referencing Variables

Working with Arrays

Determining Scope

Naming Conventions

Using Variables in Your Picture Viewer Project




HOUR 12: Performing Arithmetic, String Manipulation, and Date/Time Adjustments

Performing Basic Arithmetic Operations with Visual C#

Comparing Equalities

Understanding Boolean Logic

Working with Dates and Times




HOUR 13: Making Decisions in Visual C# Code

Making Decisions Using if...else

Evaluating an Expression for Multiple Values Using switch




HOUR 14: Looping for Efficiency

Looping a Specific Number of Times Using for

Using while and do...while to Loop an Indeterminate Number of Times




HOUR 15: Debugging Your Code

Adding Comments to Your Code

Identifying the Two Basic Types of Errors

Using Visual C# Debugging Tools

Writing an Error Handler Using Try...Catch...Finally




HOUR 16: Designing Objects Using Classes

Understanding Classes

Instantiating Objects from Classes




HOUR 17: Interacting with Users

Displaying Messages Using the MessageBox.Show() Function

Creating Custom Dialog Boxes

Interacting with the Keyboard

Using the Common Mouse Events




HOUR 18: Working with Graphics

Understanding the Graphics Object

Working with Pens

Using System Colors

Working with Rectangles

Drawing Shapes

Drawing Text

Persisting Graphics on a Form

Building a Graphics Project Example




Part IV: Working with Data

HOUR 19: Performing File Operations

Using the OpenFileDialog and SaveFileDialog Controls

Manipulating Files with the File Object

Manipulating Directories with the Directory Object




HOUR 20: Working with Text Files and the Registry

Working with the Registry

Reading and Writing Text Files




HOUR 21: Working with a Database

Introducing ADO.NET

Manipulating Data




HOUR 22: Controlling Other Applications Using Automation

Creating a Reference to an Automation Library

Creating an Instance of an Automation Server

Manipulating the Server

Automating Microsoft Word




Part V: Developing Solutions and Beyond

HOUR 23: Deploying Applications

Understanding ClickOnce Technology

Using the Publish Wizard to Create a ClickOnce Application

Testing Your Picture Viewer ClickOnce Install Program

Uninstalling an Application You’ve Distributed

Setting Advanced Options for Creating ClickOnce Programs




HOUR 24: The 10,000-Foot View

The .NET Framework

Common Language Runtime

Microsoft Intermediate Language


Common Type System

Garbage Collection

Further Reading


0672329905 TOC 5/8/2008

Read More Show Less



With Microsoft's introduction of the .NET platform, a new, exciting programming language was born. Visual C# is now the language of choice for developing on the .NET platform, and Microsoft has even written a majority of the .NET Framework using Visual C#. Visual C# is a modern object-oriented language designed and developed from the ground up with a best-of-breed mentality, implementing and expanding on the best features and functions found in other languages. Visual C# 2008 combines the power and flexibility of C++ with some of the simplicity of Visual C#.

Audience and Organization

This book is targeted toward those who have little or no programming experience or who might be picking up Visual C# as a second language. The book has been structured and written with a purpose: to get you productive as quickly as possible. I've used my experiences in writing applications with Visual C# and teaching Visual C# to create a book that I hope cuts through the fluff and teaches you what you need to know. All too often, authors fall into the trap of focusing on the technology rather than on the practical application of the technology. I've worked hard to keep this book focused on teaching you practical skills that you can apply immediately toward a development project. Feel free to post your suggestions or success stories at

This book is divided into five parts, each of which focuses on a different aspect of developing applications with Visual C# 2008. These parts generally follow the flow of tasks you'll perform as you begin creating your own programs with Visual C# 2008. I recommend that you read them in the order in which they appear.

  • Part I, "The Visual C# 2008 Environment," teaches you about the Visual C# environment, including how to navigate and access Visual C#'s numerous tools. In addition, you'll learn about some key development concepts such as objects, collections, and events.
  • Part II, "Building a User Interface," shows you how to build attractive and functional user interfaces. In this part, you'll learn about forms and controls—the user interface elements such as text boxes and list boxes.
  • Part III, "Making Things Happen: Programming," teaches you the nuts and bolts of Visual C# 2008 programming—and there's a lot to learn. You'll discover how to create classes and procedures, as well as how to store data, perform loops, and make decisions in code. After you've learned the core programming skills, you'll move into object-oriented programming and debugging applications.
  • Part IV, "Working with Data," introduces you to working with graphics, text files, and programming databases, and shows you how to automate external applications such as Word and Excel. In addition, this part teaches you how to manipulate a user's file system and the Windows Registry.
  • Part V, "Deploying Solutions and Beyond," shows you how to distribute an application that you've created to an end user's computer. In Hour 24, "The 10,000-Foot View," you'll learn about Microsoft's .NET initiative from a higher, less-technical level.

Many readers of previous editions have taken the time to give me input on how to make this book better. Overwhelmingly, I was asked to have examples that build on the examples in the previous chapters. In this book, I have done that as much as possible. Now, instead of learning concepts in isolated bits, you'll be building a feature-rich Picture Viewer program throughout the course of this book. You'll begin by building the basic application. As you progress through the chapters, you'll add menus and toolbars to the program, build an Options dialog box, modify the program to use the Windows Registry and a text file, and even build a setup program to distribute the application to other users. I hope you find this approach beneficial in that it enables you to learn the material in the context of building a real program.

Conventions Used in This Book

This book uses several design elements and conventions to help you prioritize and reference the information it contains:

Note - By the Way boxes provide useful sidebar information that you can read immediately or circle back to without losing the flow of the topic at hand.

Tip - Did You Know? boxes highlight information that can make your Visual C# programming more effective.

Caution - Watch Out! boxes focus your attention on problems or side effects that can occur in specific situations.

New terms appear italic for emphasis.

In addition, this book uses various typefaces to help you distinguish code from regular English. Code is presented in a monospace font. Placeholders—words or characters that represent the real words or characters you would type in code—appear in italic monospace. When you are asked to type or enter text, that text appears in bold.

Some code statements presented in this book are too long to appear on a single line. In these cases, a line-continuation character (an underscore) is used to indicate that the following line is a continuation of the current statement.

Onward and Upward!

This is an exciting time to be learning how to program. It's my sincerest wish that when you finish this book, you feel capable of creating, debugging, and deploying modest Visual C# programs, using many of Visual C#'s tools. Although you won't be an expert, you'll be surprised at how much you've learned. And I hope this book will help you determine your future direction as you proceed down the road to Visual C# mastery.

© Copyright Pearson Education. All rights reserved.

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted July 4, 2008

    for the neophyte

    Foxall gives us a quick coverage of C#, well suited to a neophyte. The book seems equally divided between the explanations of graphics and non-graphics. The latter means traditional aspects of any programming language, as in the use of if-else, while and for loops. Here, you might as well be studying C in 1980. These are fundamental constructs that any language needs. What is perhaps more distinctive of C# are the graphic components, widgets. Foxall shows how to quickly write short programs that can make a few widgets and lay them out in a window for the user to interact with. En route, he teaches about event driven programming, where if you use graphics, the user can interact with the program in many ways. Hence the structuring of code to handle this is quite different from programs lacking a GUI. The use of widgets also lends itself well to you understanding object oriented coding.

    1 out of 1 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)