You are previewing Sams Teach Yourself Microsoft® Visual C#™ .NET in 24 Hours.
O'Reilly logo
Sams Teach Yourself Microsoft® Visual C#™ .NET in 24 Hours

Book Description

In just 24 lessons of one hour or less, you will be creating your own Windows applications using the power and functionality of Visual C# .NET. Using a straightforward, step-by-step approach, each lesson builds on the previous ones, enabling you to learn the essentials of Visual C# .NET from the ground up.

As an added bonus, the book includes a 60-day Trial Version of Microsoft Visual Studio .NET 2003 on DVD-ROM so you will have every tool you need to create the applications demonstrated in the book.

Step-by-step instructions walk you through the most common Visual C# .NET tasks while questions and answers, quizzes, and exercises at the end of each hour help you test your knowledge. Notes and tips point out shortcuts and solutions and help steer you clear of potential problems.

You will learn...

  • The basics of Visual C# and then quickly begin applying your knowledge to real-world Windows programming tasks.

  • Important features such as building forms, working with controls, looping, debugging, and working with data in the world of .NET.

  • Tips that ease migration from Visual C++ and Visual Basic 6 to Visual c# .NET 2003.

  • Table of Contents

    1. Copyright
    2. About the Author
    3. Acknowledgments
    4. Introduction
    5. The Visual Studio .NET Environment
      1. Jumping in with Both Feet: A Visual C# .NET Programming Tour
        1. Getting Started with Visual C# .NET
        2. Creating a New Project
        3. Understanding the Visual Studio Environment
        4. Changing the Characteristics of Objects
        5. Naming Objects
        6. Setting the Text Property of the Form
        7. Giving the Form an Icon
        8. Changing the Size of the Form
        9. Adding Controls to a Form
        10. Designing an Interface
        11. Adding an Invisible Control to a Form
        12. Writing the Code Behind an Interface
        13. Running a Project
        14. Summary
        15. Q&A
        16. Workshop
      2. Navigating Visual Studio .NET
        1. Using the Visual Studio .NET Start Page
        2. Navigating and Customizing the Visual Studio .NET Environment
        3. Adding Controls to a Form Using the Toolbox
        4. Setting Object Properties Using the Properties Window
        5. Managing Projects
        6. Managing Project Files with the Solution Explorer
        7. Getting Help
        8. Summary
        9. Q&A
        10. Workshop
      3. Understanding Objects and Collections
        1. Understanding Objects
        2. Understanding Properties
        3. Understanding Methods
        4. Building a Simple Object Example Project
        5. Understanding Collections
        6. Using the Object Browser
        7. Summary
        8. Q&A
        9. Workshop
      4. Understanding Events
        1. Understanding Event-Driven Programming
        2. Building an Event Example Project
        3. Summary
        4. Q&A
        5. Workshop
    6. Building a User Interface
      1. Building Forms: The Basics
        1. Changing the Name of a Form
        2. Changing the Appearance of a Form
        3. Showing and Hiding Forms
        4. Summary
        5. Q&A
        6. Workshop
      2. Building Forms: Advanced Techniques
        1. Working with Controls
        2. Creating Topmost Windows
        3. Creating Transparent Forms
        4. Creating Scrollable Forms
        5. Creating MDI Forms
        6. Setting the Startup Object
        7. Summary
        8. Q&A
        9. Workshop
      3. Working with the Traditional Controls
        1. Displaying Static Text with the Label Control
        2. Allowing Users to Enter Text Using a Text Box
        3. Creating Buttons
        4. Creating Containers and Groups of Option Buttons
        5. Displaying a List with the List Box
        6. Creating Drop-Down Lists Using the Combo Box
        7. Summary
        8. Q&A
        9. Workshop
      4. Using Advanced Controls
        1. Creating Timers
        2. Creating Tabbed Dialog Boxes
        3. Storing Pictures in an Image List
        4. Building Enhanced Lists Using the List View
        5. Creating Hierarchical Lists with the Tree View
        6. Summary
        7. Q&A
        8. Workshop
      5. Adding Menus and Toolbars to Forms
        1. Building Menus
        2. Programming Menus
        3. Using the Toolbar Control
        4. Creating a Status Bar
        5. Summary
        6. Q&A
        7. Workshop
      6. Creating and Calling Methods
        1. Creating Class Members
        2. Defining and Writing Methods
        3. Creating the User Interface of Your Project
        4. Calling Methods
        5. Exiting Methods
        6. Working with Tasks
        7. Summary
        8. Q&A
        9. Workshop
    7. Making Things Happen—Programming
      1. Using Constants, Data Types, Variables, and Arrays
        1. Understanding Data Types
        2. Defining and Using Constants
        3. Declaring and Referencing Variables
        4. Determining Constant and Variable Scope
        5. Naming Conventions
        6. Summary
        7. Q&A
        8. Workshop
      2. Performing Arithmetic, String Manipulation, and Date/Time Adjustments
        1. Performing Basic Arithmetic Operations with Visual C# .NET
        2. Comparing Equalities
        3. Understanding Boolean Logic
        4. Manipulating Strings
        5. Working with Dates and Times
        6. Summary
        7. Q&A
        8. Workshop
      3. Making Decisions in Visual C# .NET Code
        1. Making Decisions Using if Statements
        2. Evaluating an Expression for Multiple Values Using switch
        3. Summary
        4. Q&A
        5. Workshop
      4. Looping for Efficiency
        1. Looping a Specific Number of Times Using for Statements
        2. Using do...while to Loop an Indeterminate Number of Times
        3. Summary
        4. Q&A
        5. Workshop
      5. Debugging Your Code
        1. Adding Comments to Your Code
        2. Identifying the Two Basic Types of Errors
        3. Using Visual C# .NET's Debugging Tools
        4. Writing an Error Handler Using try...catch...finally
        5. Summary
        6. Q&A
        7. Workshop
      6. Designing Objects Using Classes
        1. Understanding Classes
        2. Instantiating Objects from Classes
        3. Summary
        4. Q&A
        5. Workshop
      7. Interacting with Users
        1. Displaying Messages Using the MessageBox.Show() Method
        2. Crafting Good Messages
        3. Creating Custom Dialog Boxes
        4. Interacting with the Keyboard
        5. Using the Common Mouse Events
        6. Summary
        7. Q&A
        8. Workshop
      8. Working with Graphics
        1. Understanding the Graphics Object
        2. Working with Pens
        3. Using System Colors
        4. Working with Rectangles
        5. Drawing Common Shapes
        6. Printing Text on a Graphics Object
        7. Persisting Graphics on a Form
        8. Building a Graphics Project
        9. Summary
        10. Q&A
        11. Workshop
    8. Working with Data
      1. Performing File Operations
        1. Using the Open File Dialog and Save File Dialog Controls
        2. Manipulating Files with the File Object
        3. Manipulating Directories with the Directory Object
        4. Summary
        5. Q&A
        6. Workshop
      2. Controlling Other Applications Using Automation
        1. Creating a Reference to an Automation Library
        2. Creating an Instance of an Automation Server
        3. Manipulating the COM Server from the Client Code
        4. Summary
        5. Q&A
        6. Workshop
      3. Working with a Database
        1. Introduction to ADO.NET
        2. Connecting to a Database
        3. Manipulating Data
        4. Using the Data Form Wizard
        5. Summary
        6. Q&A
        7. Workshop
    9. Deploying Solutions and Beyond
      1. Deploying a Visual C# .NET Solution
        1. Creating a Custom Setup Program
        2. Running a Custom Setup Program
        3. Uninstalling an Application
        4. Summary
        5. Q&A
        6. Workshop
      2. Introduction to Web Development
        1. Understanding ASP.NET
        2. Creating Dynamic Web Content with Web Forms
        3. Understanding XML Web Services
        4. Summary
        5. Q&A
        6. Workshop
      3. Building a Real-World Application
        1. Building the Interface
        2. Building the Main Menu
        3. Building the Toolbar
        4. Adding the List View to Display Albums
        5. Adding the Browse For Database OpenFileDialog Control
        6. Writing the Code for the CD Cataloger
        7. Testing Your Application
    10. Appendices
      1. The 10,000-Foot View
        1. The .NET Framework
        2. The Common Language Runtime
        3. Microsoft Intermediate Language
        4. Namespaces and Classes in .NET
        5. Common Type System
        6. Garbage Collection
      2. Answers to Quizzes
        1. Hour 1
        2. Hour 2
        3. Hour 3
        4. Hour 4
        5. Hour 5
        6. Hour 6
        7. Hour 7
        8. Hour 8
        9. Hour 9
        10. Hour 10
        11. Hour 11
        12. Hour 12
        13. Hour 13
        14. Hour 14
        15. Hour 15
        16. Hour 16
        17. Hour 17
        18. Hour 18
        19. Hour 19
        20. Hour 20
        21. Hour 21
        22. Hour 22
        23. Hour 23
    11. Index