2. Forms
In a technology named Windows Forms, you can expect the form to play a critical role. This chapter explores the basics, including displaying forms, form lifetime, form size and location, nonclient form adornments, menu strips, tool ...
Showing Forms
Any formthat is, any class that derives from the Form base classcan be shown in one of two ways. Here, a form is shown modelessly:
void button_Click(object sender, EventArgs e) {
AnotherForm form = new AnotherForm();
form.Sh...
Form Lifetime
Although the user can't see a form until either Show or ShowDialog is called, a form comes into existence as soon as a form object is instantiated. From there, its lifetime is measured by a series of events that you can handle to con...
Form Notification
Some applications, such as games, are unlikely to continue processing while deactivated because they are user-input intensive. Other applications, however, can continue executing in the background and don't need to halt processin...
Form Size and Location
When a form isn't lurking in the background behind a notification icon or task bar button, it is visible in the foreground and takes up space in some location on the screen. A form's initial location is governed by the Start...
Form Adornments
In addition to size and location, forms have a number of properties that manage various other aspects of their appearance and corresponding behavior. The following settings govern the nonclient adornments of a form: those parts of ...
Form Transparency
In addition to the properties that specify how the nonclient area of a form are rendered by Windows, the Form class provides a set of properties that allow you to change the appearance of the form as a whole, including making it ...
Form and Context Menus
As interesting as forms themselves arewith their lifetime, adornments, transparency settings, and input optionsthey're all the more interesting when they contain controls. Apart from system-provided adornments like...
Tool Strips
As an application offers a greater number of commands, the associated menu items can become more deeply hidden within a burgeoning menu strip hierarchy. This means that users likely spend more time searching for a specific command. If ...
Status Strips
Whereas tool strips provide visual shortcuts to application commands, status strips provide visual shortcuts to details about application status and context. For example, VS05 itself uses the status strip effectively by providing inf...
Multiple Document Interface Applications
Menu merging is one of several important features commonly supported by MDI applications. VS05 and the .NET Framework provide a variety of tools for you to use in implementing these features.
MDI Form Co...
Visual Inheritance
After all the settings and behavior details you've learned to pack into forms, you may decide to keep some of your hard work in a form-derived base class for easy reuse, and you can certainly do that. If you follow the...
Where Are We?
We've explored how to show forms; control their lifetime, size, and location; dictate their nonclient adornments; manage main menus, context menus, tool strips, and status strips; make whole forms partially transparent and parts of...
С 2009 года мы стали переводить структура сайта на различные языки. Сайт теперь будет содержать книги не только на английском языке, но также и на других европейских языках, в том числе и на Русском языке.