Chapter 3. Forms, Containers, and Applications
Any interactive application must have at least one window through
which to present its user interface. In the Windows Forms framework,
all such top-level application windows are represented by objects
whose types derive from the Form class. As with
any user interface element, the Form class
inherits from the Control class, but it adds
windowing features, such as management of the window border and
interaction with the Windows taskbar. All Windows Forms applications
have at least one class derived from Form.
In this chapter we will examine the structure of a typical Windows
Forms application and the way its constituent forms are created. We
will look at the programming model for forms, and the way that the
Visual Studio .NET Forms Designer uses this model. We will look in
detail at the relationship between a form and the controls it
contains, and also at the relationships that can exist between forms.
The mechanisms underpinning the automatic layout features described
in the previous chapter will be examined, and we will see how to use
these to add our own custom layout facilities.
|