Cover image for Sams teach yourself C# in 24 hours
Sams teach yourself C# in 24 hours
Foxall, James D.
Personal Author:
Publication Information:
Indianapolis, IN : Sams Publishing, [2002]

Physical Description:
xvi, 506 pages : illustrations ; 24 cm.
General Note:
Includes index.
Added Author:

Format :


Call Number
Material Type
Home Location
Item Holds
QA76.73.C154 F69 2002 Adult Non-Fiction Central Closed Stacks

On Order



Sams Teach Yourself C# in 24 Hours provides readers with 24 structured lessons that provide a light, but thorough introduction to C#. James Foxall moves beyond the pure syntax covered in existing books, to guide readers step-by-step through a cohesive presentation of the basics of C#. Once the basics are understood, Foxall shows the reader how to apply this knowledge to real-world Windows programming tasks using C#. Each chapter contains exercises that reinforce the lessons learned in each chapter. Tips, Notes, and Cautions provide additional advice from the authors on how to get up to speed and programming quickly with C#. Sidebars provide the more experienced reader with tips that will ease their migration from Visual Basic 6 and Visual C++ to C#.

Author Notes

James Foxall is vice president of Tigerpaw Software, Inc., and is a Microsoft Certified Solution Developer (MCSD)
Wendy Haro-Chun, MCSD, holds a Bachelor's in Computer Science and an MBA with an emphasis in International Business. She is Assistant Vice President of Research & Development for SunGard Insurance Systems

Table of Contents

Introductionp. 1
Audience and Organizationp. 1
Conventions Used in This Bookp. 2
Onward and Upward!p. 2
Part I The Visual Studio Environmentp. 3
Hour 1 A C# Programming Tourp. 5
Starting C#p. 6
Creating a New Projectp. 7
Understanding the C# Environmentp. 9
Changing the Characteristics of Objectsp. 10
Naming Objectsp. 10
Setting the Text Property of the Formp. 11
Giving the Form an Iconp. 12
Changing the Size of the Formp. 12
Adding Controls to a Formp. 14
Designing an Interfacep. 15
Adding an Invisible Control to a Formp. 17
Coding an Interfacep. 19
Running a Projectp. 23
Hour 2 Navigating C#p. 27
Using the Visual Studio .NET Start Pagep. 28
Navigating and Customizing the C# Environmentp. 31
Adding Controls to a Form Using the Toolboxp. 42
Setting Object Properties Using the Properties Windowp. 43
Managing Projectsp. 48
Managing Project Files with the Solution Explorerp. 48
Getting Helpp. 55
Hour 3 Understanding Objects and Collectionsp. 61
Understanding Objectsp. 62
Understanding Propertiesp. 63
Understanding Methodsp. 69
Building an Object Example Projectp. 71
Understanding Collectionsp. 76
Using the Object Browserp. 79
Hour 4 Understanding Eventsp. 83
Understanding Event-Driven Programmingp. 84
Building an Event Example Projectp. 91
Part II Building a User Interfacep. 99
Hour 5 Building Forms--Part Ip. 101
Changing the Name of a Formp. 102
Changing the Appearance of a Formp. 103
Showing and Hiding Formsp. 114
Hour 6 Building Forms--Part IIp. 121
Working with Controlsp. 122
Creating TopMost Windowsp. 137
Creating Transparent Formsp. 137
Creating Scrollable Formsp. 138
Creating MDI Formsp. 139
Setting the Startup Objectp. 143
Hour 7 Working with the Traditional Controlsp. 147
Displaying Static Text with the Label Controlp. 148
Allowing Users to Enter Text Using a Text Boxp. 149
Creating Buttonsp. 155
Creating Containers and Groups of Option Buttonsp. 159
Displaying a List with the List Boxp. 164
Creating Drop-Down Lists Using the Combo Boxp. 171
Hour 8 Advanced Controlsp. 175
Creating Timersp. 176
Creating Tabbed Dialog Boxesp. 178
Storing Pictures in an Image Listp. 181
Building Enhanced Lists Using the List Viewp. 182
Creating Hierarchical Lists with the Tree Viewp. 187
Hour 9 Adding Menus and Toolbars to Formsp. 193
Building Menusp. 194
Programming Menusp. 198
Using the Toolbar Controlp. 203
Creating a Status Barp. 209
Hour 10 Drawing and Printingp. 213
Understanding the Graphics Objectp. 214
Working with Pensp. 216
Using System Colorsp. 217
Working with Rectanglesp. 220
Drawing Shapesp. 221
Drawing Textp. 223
Persisting Graphics on a Formp. 224
Build a Graphics Project Examplep. 225
Part III Making Things Happen--Programming!p. 233
Hour 11 Creating and Calling Methodsp. 235
Creating Class Membersp. 236
Writing Methodsp. 238
Creating the User Interface of Your Projectp. 242
Calling Methodsp. 245
Exiting Methodsp. 251
Working with Tasksp. 252
Hour 12 Using Constants, Data Types, Variables, and Arraysp. 257
Understanding Data Typesp. 258
Defining and Using Constantsp. 262
Declaring and Referencing Variablesp. 263
Determining Scopep. 268
Naming Conventionsp. 273
Hour 13 Performing Arithmetic, String Manipulation, and Date/Time Adjustmentsp. 277
Performing Basic Arithmeticp. 278
Comparing Equalitiesp. 282
Understanding Boolean Logicp. 283
Manipulating Stringsp. 286
Working with Dates and Timesp. 290
Hour 14 Making Decisions in C# Codep. 295
Making Decisions Using if Statementsp. 296
Evaluating an Expression for Multiple Values Using switchp. 300
Branching Within Code Using gotop. 305
Hour 15 Looping for Efficiencyp. 309
Looping a Specific Number of Times Using for Statementsp. 310
Using do...While to Loop an Indeterminate Number of Timesp. 314
Hour 16 Debugging Your Codep. 321
Adding Comments to Your Codep. 323
Identifying the Two Basic Types of Errorsp. 325
Using C#'s Debugging Toolsp. 327
Writing an Error Handler Using try...catch...finallyp. 332
Hour 17 Designing Objects Using Classesp. 341
Understanding Classesp. 342
Instantiating Objects from Classesp. 350
Hour 18 Interacting with Usersp. 357
Displaying Messages Using the MessageBox.Show() Methodp. 358
Creating Custom Dialog Boxesp. 364
Interacting with the Keyboardp. 367
Using the Common Mouse Eventsp. 370
Part IV Working with Datap. 375
Hour 19 Performing File Operationsp. 377
Using the Open File Dialog and Save File Dialog Controlsp. 378
Manipulating Files with the File Objectp. 382
Manipulating Directories with the Directory Objectp. 391
Hour 20 Controlling Other Applications Using Automationp. 395
Creating a Reference to an Automation Libraryp. 396
Creating an Instance of an Automation Serverp. 398
Manipulating the Serverp. 398
Hour 21 Working with a Databasep. 405
Introduction to ADO.NETp. 406
Connecting to a Databasep. 406
Manipulating Datap. 409
Using the Data Form Wizardp. 419
Part V Deploying Solutions and Beyondp. 425
Hour 22 Deploying a Solutionp. 427
Creating a Custom Setup Programp. 428
Running a Custom Setup Programp. 434
Uninstalling an Application You've Distributedp. 437
Hour 23 Introduction to Web Developmentp. 439
XMLp. 440
SOAPp. 441
ASP.NETp. 441
Web Formsp. 441
XML Web Servicesp. 444
Hour 24 The 10,000-Foot Viewp. 447
The .NET Frameworkp. 448
Common Language Runtime (CLR)p. 448
Microsoft Intermediate Languagep. 449
Namespacesp. 451
Common Type Systemp. 452
Garbage Collectionp. 452
Appendixp. 455
Indexp. 471