Export (0) Print
Expand All

Introduction to Windows Forms

Visual Studio .NET 2003

Windows Forms is the new platform for Microsoft Windows application development, based on the .NET Framework. This framework provides a clear, object-oriented, extensible set of classes that enable you to develop rich Windows applications. Additionally, Windows Forms can act as the local user interface in a multi-tier distributed solution.

What Is a Form?

A form is a bit of screen real estate, usually rectangular, that you can use to present information to the user and to accept input from the user. Forms can be standard windows, multiple document interface (MDI) windows, dialog boxes, or display surfaces for graphical routines. The easiest way to define the user interface for a form is to place controls on its surface. Forms are objects that expose properties which define their appearance, methods which define their behavior, and events which define their interaction with the user. By setting the properties of the form and writing code to respond to its events, you customize the object to meet the requirements of your application.

As with all objects in the .NET Framework, forms are instances of classes. The form you create with the Windows Forms Designer is a class, and when you display an instance of the form at run time, this class is the template used to create the form. The framework also allows you to inherit from existing forms to add functionality or modify existing behavior. When you add a form to your project, you can choose whether it inherits from the Form class provided by the framework, or from a form you have previously created.

Additionally, forms are controls, because they inherit from the Control class.

Within a Windows Forms project, the form is the primary vehicle for user interaction. By combining different sets of controls and writing code, you can elicit information from the user and respond to it, work with existing stores of data, and query and write back to the file system and registry on the user's local computer.

Although the form can be created entirely in the Code Editor, it is easier to use the Windows Forms Designer to create and modify forms. For more information, see Creating Windows Forms.

Visual Basic Note   Previous versions of Visual Basic had a Windows application framework that was integrated with the Visual Basic development environment. The new framework provides more application features, improved localization support, and a more extensible designer architecture. For differences, see Forms Task Changes in Visual Basic .NET.

See Also

Anatomy of the Visual Basic Code Behind Windows Forms | Displaying Windows Forms in the Designer | Windows Forms as the Presentation Tier of a Three-Tier Application | Dialog Boxes in Windows Forms | What's New in Windows Forms and Controls

Show:
© 2014 Microsoft