Flylib.com

Books Software

 
 
 

Assessing Readiness for Exam 70-306

Assessing Readiness for Exam 70-306

In addition to the general exam-readiness information in the previous section, there are several things you can do to prepare for the "Developing and Implementing Windows-Based Applications with Microsoft Visual Basic .NET and Microsoft Visual Studio .NET"exam. We suggest that you join an active Microsoft Developers mailing list, obtain a Microsoft Developer Network (MSDN) subscription, and regularly visit the MSDN Web site for new information (http://msdn.microsoft.com).

Microsoft exam mavens also recommend checking the Microsoft Knowledge Base (integrated into the MSDN CD-ROM, or on the Microsoft Web site at http://support.microsoft.com/support/) for "meaningful technical support issues" that relate to your exam's topics. Although we're not sure exactly what the quoted phrase means, we have noticed some overlap between technical support questions on particular products and troubleshooting questions on the exams for those products.

Onward, Through the Fog!

After you've assessed your readiness, undertaken the right background studies, obtained the hands-on experience that will help you understand the products and technologies at work, and reviewed the many sources of information to help you prepare for a test, you'll be ready to take a round of practice tests. When your scores come back positive enough to get you through the exam, you're ready to go after the real thing. If you follow our assessment regime , you'll not only know what you need to study but also when you're ready to make a test date at Prometric (www. prometric .com) or VUE (www.vue.com). Good luck!

Chapter 1. Introducing Windows Forms

Terms you'll need to understand:

  • .NET Framework

  • Common Language Runtime (CLR)

  • Framework class library (FCL)

  • Integrated Development Environment (IDE)

  • Class

  • Inheritance

  • Namespace

  • Application class

  • Form class

  • Event handling

  • Delegate

  • System.Drawing namespace

  • Draw method

  • Fill method

Techniques you'll need to master:

  • Creating a form and editing its properties using the Properties window and within the form's code

  • Identifying the two types of event handling (overriding protected methods and attaching delegates) and understanding their use

  • Understanding the use of the Draw and Fill methods

A user interface allows information to be input and modified for use by the application. Many types of controls can be added to the user interface to allow different types of information manipulation, specification, and selection. A Windows form may be used in order to integrate these controls and provide a structure for the deployed interface. In this chapter, we examine the basic creation of Windows forms using the Visual Studio .NET development environment and simple event handling.

Introduction to the .NET Development Environment

The Microsoft .NET initiative involves a change in the fundamental structure of development and deployment. The .NET development platform integrates support for multiple development languages such as Visual Basic .NET and C# (pronounced see-sharp ) with the Common Language Runtime (CLR) and a shared Framework class library (FCL). These allow programmers to perform programmatic development in whatever language they are most comfortable, with a final solution integrating all the various code segments through common classes and runtime library inclusions.

graphics/note_icon.gif

In order to prepare a server to support .NET applications, the Common Language Runtime (CLR) must be present. This is accomplished by loading the .NET Framework available through the Windows Update site or included within the .NET Software Development Kit (SDK) available through the Microsoft MSDN downloads site. Alternatively, if you don't intend to perform development on the server, you can use the smaller .NET Framework redistributable package.


Code development for the .NET environment may be performed using a text editor and the command-line compilers within the .NET SDK, but a more robust solution exists in the form of Microsoft's Visual Studio .NET product. This product includes an Integrated Development Environment (IDE) and advanced editing tools that make it possible to rapidly evaluate code and other .NET structures, use integrated debugging and automation tools, and integrate with the Windows Installer deployment utility in order to simplify application distribution and update.

graphics/alert_icon.gif

You are expected to be able to recognize utilities within the Integrated Development Environment (IDE) and to know how to use the Visual Studio .NET product and to understand code written using the Visual Basic .NET language.


Objects and Classes

Visual Basic .NET is an object-oriented language in which every construct is considered an object that has associated properties and methods and may contain other objects in turn . The abstract concept of a group of objects with common qualities is termed a class .

graphics/tip_icon.gif

The class is a fundamental concept you will encounter throughout this book and is one you should be very familiar with.


A class is a blueprint for an object rather than an object itself. Classes will have many properties, some created by the developer and others derived from the class itself. The properties and methods of a class can be split into two categories:

  • Static members Fields, methods, events, or properties that belong to the class itself rather than to a particular instance of that class

  • Instance members Fields, methods, events, or properties that belong to an individual object (an instance of a class)

A class encapsulates both data and behavior into a single concept. In addition to having its own members, a class may inherit some or all of its members from a parent class.

Class Inheritance

Specific methods of assigning inheritance are discussed later in this chapter, but Figure 1.1 provides an example of the chain of inheritance from a Windows form through its parent and that, in turn, back to the most fundamental classthe Object class.

Figure 1.1. An example of class inheritance in which the Form class inherits from its parent classes.

graphics/01fig01.gif

The properties, or members , of a class that may be inherited can be limited by including an access modifier in their declaration. Within the Visual Studio .NET environment are four access modifiers you should be aware of:

  • Public This member is globally accessible.

  • Private This member is accessible only within its own class. This is the default.

  • Protected This member is accessible within its own class and all classes derived from this class.

  • Friend This member is accessible to all classes within the current project.

Namespace

The Visual Studio .NET development environment includes hundreds of classes, and you will develop many more for each project. In order to provide organization and structure to what could rapidly become an unmanageable number of classes, the development environment makes use of the concept of a namespace . This is a hierarchical naming system in which classes may be grouped as required.

The standard naming convention for creation of a namespace is as follows :


CompanyName.ApplicationName

An example of this would be the creation of a namespace for this book: ExamCram2.70306 . Here, 70306 is the child namespace of the parent ExamCram2 namespace. If you created a class, ExamItems , within the 70306 namespace, the class would be designated as ExamCram2.70306.ExamItems . A separate ExamItems class could exist within a different namespace, such as in ExamCram2.70316.ExamItems . These are unrelated classes sharing only the common class name and are separated by the namespace groupings of 70306 and 70316 within the parent ExamCram2 namespace.

The root namespace including all others is the System namespace. This contains the Object class ( System.Object ), which is the parent for all other classes in the .NET Framework. System also includes other objects and namespaces that we will deal with, such as the System.Drawing namespace, which includes classes used to create graphical elements, and the System.Windows namespace, which includes the System.Windows.Forms child namespace that includes the classes used to create Windows form objects.

graphics/note_icon.gif

The namespace hierarchy is simply used to organize classes and is separate from the hierarchy in a chain of class inheritance. A class may inherit members from another class located in any other namespace.


Now that you are familiar with the basics of the conceptual side of the .NET development environment, we will examine the creation of a form within the Windows Form Designer.