This lesson describes how to create and configure Windows Forms. You will learn how to create forms and refer to them in code, alter the visual properties of the form, and control the behavior of the form at run time.
After this lesson, you will be able to:
■ Add a Windows Form to a project at design time.
■ Add a new Windows Form at run time.
■ Resize a window at design time or run time.
■ Identify and set the properties that determine a form’s appearance and behavior at run time. ■ Refer to the default instance of a form in code.
■ Create a non-rectangular form. Estimated lesson time: 45 minutes
Overview of Windows Forms
Windows Forms are the basic building block of the user interface. They provide a container that hosts controls and menus and allow you to present an application in a familiar and consistent fashion. Forms can receive user input in the form of keystrokes
or mouse interactions and can display data to the user through hosted controls.
Although it is possible to create applications that do not contain forms, such as console applications or services, most applications that require sustained user interaction will include at least one Windows Form, and complex applications frequently
require several forms to allow the program to execute in a consistent and logical fashion.
When you create a new Windows Forms project, a form named Form1 is added to your project by default. You can edit your form by adding controls and other visual elements in the designer, which is a graphic representation of a designable, visual element
(such as a Form) that appears in the Visual Studio Integrated Development Environment
(IDE).
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment