Training
Certifications
Books
Special Offers
Community




 
MCAD/MCSD Self-Paced Training Kit: Developing Windows®-Based Applications with Microsoft® Visual Basic® .NET and Microsoft Visual C#® .NET, Second Ed
Author Matthew A. Stoecker with Microsoft Corporation
Pages 624
Disk 1 Companion CD(s); 1 DVD(s)
Level Beg/Int
Published 05/14/2003
ISBN 9780735619265
Price $69.99
To see this book's discounted price, select a reseller below.
 

More Information

About the Book
Table of Contents
Sample Chapter
Index
Related Series
Related Books
About the Author

Support: Book & CD

Rate this book
Barnes Noble Amazon Quantum Books

 

Table of Contents


About This Bookxv
CHAPTER 1 Introduction to the .NET Framework1
        About This Chapter1
        Before You Begin1
    Lesson 1: The .NET Framework and the Common Language Runtime2
        Overview of the .NET Framework2
        Languages and the .NET Framework2
        The Structure of a .NET Application3
        Compilation and Execution of a .NET Application4
        Lesson Summary5
    Lesson 2: The .NET Base Class Library6
        Reference Types and Value Types8
        Using .NET Framework Types in Your Application9
        The Imports and Using Statements12
        Referencing External Libraries13
        Lesson Summary14
    Lesson 3: Using Classes and Structures15
        Members15
        Creating Classes16
        Creating Structures16
        Adding Members16
        Nested Types17
        Instantiating User-Defined Types18
        Classes vs. Structures19
        Lesson Summary19
    Lesson 4: Using Methods20
        Adding Methods20
        Calling Methods21
        Method Variables21
        Parameters22
        Constructors and Destructors25
        Lesson Summary26
    Lesson 5: Scope and Access Levels27
        Member Access Modifiers27
        Type Access Modifiers29
        Access Modifiers for Nested Types30
        Shared (static) Members30
        Lesson Summary32
    Lesson 6: Garbage Collection33
        Circular References34
        Lesson Summary35
    Lab 1: Classes and Garbage Collection36
        Before You Begin36
        Exercise 1.1: Making the Demo Class36
        Exercise 1.2: Demonstrating Garbage Collection37
    Review39
CHAPTER 2 Creating the User Interface41
        About This Chapter41
        Before You Begin41
    Lesson 1: User Interface Design Principles42
        Forms, Controls, and Menus43
        Composition44
        Simplicity44
        Position of Controls45
        Consistency45
        Aesthetics45
        Lesson Summary47
    Lesson 2: Using Forms48
        Adding Forms to Your Project48
        Visual Inheritance49
        Setting the Start-Up Form50
        Setting the Start-Up Location52
        Changing the Appearance of Your Form53
        BackColor, ForeColor, and Text Properties54
        Font, Cursor, and BackGroundImage54
        Opacity54
        Using Form Methods55
        Show and ShowDialog56
        Activate56
        Hide57
        Close57
        Using Form Events57
        Event Arguments59
        Form Lifetime Events60
        Lesson Summary62
    Lesson 3: Using Controls and Components64
        Working with Controls64
        Setting the Control Tab Order66
        Controls That Can Contain Other Controls67
        Docking and Anchoring Controls68
        Using the Controls Collection71
        Adding Controls to the Toolbox72
        Creating Event Handlers for Controls73
        Interacting with the Mouse74
        Using Extender Provider Components76
        Lesson Summary77
    Lesson 4: Using Menus78
        Creating Menus During Design78
        Using the MainMenu Component78
        Separating Menu Items80
        Menu Access and Shortcut Keys80
        Using Menu Item Events81
        Creating Context Menus82
        Modifying Menus at Run Time82
        Enabling and Disabling Menu Commands82
        Displaying Check Marks on Menu Items83
        Displaying Radio Buttons on Menu Items83
        Making Menu Items Invisible83
        Cloning Menus84
        Merging Menus at Run Time84
        Adding Menu Items at Run Time85
        Lesson Summary86
    Lesson 5: Validating User Input87
        Field-Level Validation87
        Using Events in Field-Level Validation88
        Handling the Focus91
        Form-Level Validation93
        Providing User Feedback95
        Lesson Summary98
    Lab 2: The Virtual Doughnut Factory99
        Before You Begin99
        Exercise 2.1: Creating the User Interface99
        Exercise 2.2: Adding a Menu103
        Exercise 2.3: Creating Validation Handlers104
        Review107
CHAPTER 3 Types and Members109
        About This Chapter109
        Before You Begin109
    Lesson 1: Using Data Types110
        The .NET Data Types110
        Converting Types113
        Using Data Type Functionality116
        Lesson Summary119
    Lesson 2: Using Constants, Enums, Arrays, and Collections120
        Constants and Enumerations120
        Arrays124
        Multidimensional Arrays126
        Collections128
        Enumerating the Members of an Array or a Collection131
        Lesson Summary133
    Lesson 3: Implementing Properties134
        Implementing Properties134
        Read-Only and Write-Only Properties137
        Parameterized Properties138
        Default Properties and Indexers139
        Collection Properties140
        Lesson Summary142
    Lesson 4: Implementing Delegates and Events144
        Delegates144
        Declaring and Raising Events146
        Implementing Event Handlers147
        Event Handlers That Handle Multiple Events149
        Events with Multiple Handlers149
        Removing Handlers at Run Time150
        Lesson Summary151
    Lab 3-1: Adding Components and Implementing Members152
        Before You Begin152
        Exercise 3.1: Creating the DoughnutMachine Component152
        Exercise 3.2: Adding the DoughnutMachine to the User Interface159
    Lab 3-2: Creating a Class164
        Before You Begin164
        Exercise 3.3: Creating the Fraction Class164
        Exercise 3.4: Testing the Fraction Class167
    Review170
CHAPTER 4 Object-Oriented Programming and Polymorphism171
        About This Chapter171
        Before You Begin171
    Lesson 1: Introduction to Object-Oriented Programming 172
        Objects, Members, and Abstraction 172
        Encapsulation 174
        Polymorphism 174
        Lesson Summary 175
    Lesson 2: Overloading Members 177
        Creating Overloading Methods 178
        Overloading Operators with Visual C# 179
        Lesson Summary 181
    Lesson 3: Interface Polymorphism 182
        Defining Interfaces 182
        Polymorphism with Interfaces 184
        Implementing Interfaces 185
        Lesson Summary 188
    Lesson 4: Inheritance Polymorphism 190
        Inheritance 190
        Inherited Members 192
        Abstract Classes and Members 199
        Lesson Summary 202
    Lab 4: Using Inherited Classes 203
        Before You Begin203
        Exercise 4.1: Creating the CompoundFraction Class 203
        Exercise 4.2: Creating Overloaded Operators or Shared Methods 208
        Exercise 4.3: Creating a Strongly Typed Collection Class 209
        Review 215
CHAPTER 5 Testing and Debugging Your Application217
        About This Chapter217
        Before You Begin217
    Lesson 1: Using the Debugging Tools218
        Types of Errors218
        Break Mode220
        Setting Breakpoints223
        Breakpoint Properties and Setting Breakpoint Conditions225
        Using the Debugging Windows226
        Lesson Summary230
    Lesson 2: Using the Debug and Trace Classes231
        How Tracing Works231
        Writing Trace and Debug Output232
        The Listeners Collection233
        Using Trace Switches236
        Configuring Trace Switches238
        Lesson Summary240
    Lesson 3: Creating a Unit Test Plan241
        The Unit Test Plan241
        Lesson Summary245
    Lesson 4: Handling and Throwing Exceptions246
        How Exceptions Are Handled246
        Creating an Exception Handler247
        Throwing Exceptions251
        Lesson Summary255
    Lab 5-1: Debugging an Application256
        Before You Begin256
        Exercise 5-1.1: Identifying Syntax Errors256
        Exercise 5-1.2: Identifying Run-Time Errors257
        Exercise 5-1.3: Identifying Logical Errors258
    Lab 5-2: Creating, Throwing, and Handling Exceptions260
        Before You Begin260
        Exercise 5-2.1: Creating the MyDivideByZeroException class260
        Exercise 5-2.2: Raising Exceptions261
        Exercise 5-2.3: Handling Exceptions262
    Lab 5-3: Implementing Tracing264
        Before You Begin264
        Exercise 5-3.1: Adding Trace Functionality264
        Exercise 5-3.2: Creating a .config File and Testing Tracing265
    Review267
CHAPTER 6 Data Access Using ADO.NET269
        About This Chapter269
        Before You Begin269
    Lesson 1: Overview of ADO.NET270
        Disconnected Database Access270
        ADO.NET Data Architecture271
        Lesson Summary274
    Lesson 2: Overview of Structured Query Language275
        The SELECT Statement275
        The DELETE Statement278
        The UPDATE Statement278
        The INSERT INTO Statement279
        Lesson Summary279
    Lesson 3: Accessing Data281
        Connecting to a Database281
        Using Data Commands284
        Using DataReaders290
        Creating and Configuring DataAdapters297
        Retrieving Data Using DataAdapters300
        Lesson Summary305
    Lesson 4: Using DataSet Objects and Updating Data306
        Creating and Filling DataSet Objects Without a DataAdapter306
        DataRelation Objects311
        Constraints312
        Editing and Updating Data315
        Lesson Summary322
    Lesson 5: Binding, Viewing, and Filtering Data323
        Data Binding323
        Filtering and Sorting Data331
        Lesson Summary336
    Lesson 6: Using XML in ADO.NET337
        Retrieving XML from a SQL Server 2000 Database337
        Using XML with DataSets338
        Using the XmlDataDocument Class340
        Lesson Summary343
    Lab 6-1: Connecting with a Database345
        Before You Begin345
        Exercise 6-1.1: Adding Data Access and Using the DataReader345
        Exercise 6-1.2: Retrieving and Updating Data Using DataAdapter Objects and a DataSet347
        Exercise 6-1.3: Creating a Typed DataSet Using the XML Designer349
        Exercise 6-1.4: Using the Data Form Wizard351
    Lab 6-2: Connecting with an XML Data Store354
        Before You Begin354
        Exercise 6-2.1: Accessing the XML Data Store354
    Review357
CHAPTER 7 Creating Controls Using the .NET Framework359
        About This Chapter359
        Before You Begin359
    Lesson 1: Using GDI+360
        The System.Drawing Namespaces360
        The Graphics Object361
        Color, Brushes, and Pens365
        Rendering Simple Shapes368
        Rendering Text369
        Rendering Complex Shapes370
        Lesson Summary373
    Lesson 2: Authoring Controls374
        Overview of Control Authoring374
        Creating an Inherited Control377
        Creating a User Control379
        Creating a Custom Control382
        Lesson Summary383
    Lesson 3: Common Tasks Using Controls385
        Adding Your Control to the Toolbox385
        Providing a Toolbox Bitmap for Your Control386
        Debugging Your Control387
        Managing Control Licensing388
        Hosting Your Control in Internet Explorer390
        Lesson Summary391
    Lab 7: Creating a Custom Control392
        Before You Begin392
        Exercise 7.1: Creating the Control392
        Exercise 7.2: Testing Your Control397
    Review399
CHAPTER 8 Advanced .NET Framework Topics401
        About This Chapter401
        Before You Begin401
    Lesson 1: Implementing Print Functionality402
        The PrintDocument Component402
        Printing Content405
        Using PrintPreviewControl411
        Configuring Printing412
        Lesson Summary415
    Lesson 2: Accessing and Invoking Components417
        Accessing .NET and COM Type Libraries417
        Instantiating ActiveX Controls419
        Accessing a Web Service419
        Accessing the Windows API424
        Lesson Summary425
    Lesson 3: Implementing Accessibility427
        Accessibility Design427
        Accessibility and the Certified for Windows Program428
        Accessibility Properties of Windows Forms Controls429
        Lesson Summary430
    Lesson 4: Implementing Help in Your Application431
        The Help Class431
        The HelpProvider Component432
        Lesson Summary433
    Lesson 5: Globalization and Localization434
        Globalization and Localization434
        Culture-Specific Formatting439
        Lesson Summary443
    Lab 8: Creating a Localized Form with Print Support445
        Before You Begin445
        Exercise 8.1: Creating the Form445
        Exercise 8.2: Localizing the Form448
        Exercise 8.3: Adding Print Support451
    Review454
CHAPTER 9 Assemblies, Configuration, and Security455
        About This Chapter455
        Before You Begin455
    Lesson 1: Assemblies and Resources456
        Assemblies456
        Resources and Resource Assemblies458
        Shared Assemblies465
        Lesson Summary467
    Lesson 2: Configuring and Optimizing Your Application469
        Creating the Configuration File469
        Configuring Your Application Using Dynamic Properties471
        Optimizing Your Application's Performance475
        Lesson Summary477
    Lesson 3: Securing Your Application478
        Permissions479
        Configuring Role-Based Authorization479
        Configuring Code Access Security484
        Using Exception Handling with Imperative Security490
        Configuring Network and Machine Code Access Security Policy491
        Lesson Summary494
    Lab 9: Configuring and Securing an Application495
        Before You Begin495
        Exercise 9.1: Adding the Configuration File495
        Exercise 9.2: Securing Your Application497
    Review500
CHAPTER 10 Deploying Your Application501
        About This Chapter501
        Before You Begin501
    Lesson 1: Planning the Deployment of Your Project502
        XCOPY Deployment502
        Creating Setup Projects503
        Configuring Build Properties of Your Setup Project507
        Building, Distributing, and Deploying a Setup Project511
        Lesson Summary514
    Lesson 2: Configuring Your Setup Project515
        Setting the Setup Project Properties515
        The Installation Editors517
        Installing a Native Assembly Image529
        Verifying Installed Assembly Security Policies529
        Lesson Summary530
    Lab 10: Creating an Installer Application531
        Before You Begin531
        Exercise 10.1: Creating the Setup Project531
        Exercise 10.2: Configuring Your Application532
        Exercise 10.3: Installing Your Application532
    Review534
APPENDIX A Questions and Answers535
GLOSSARY549
INDEX557



Last Updated: May 15, 2003
Top of Page