CHAPTER 19 BUILDING A (Ipower web hosting) BETTER WINDOW WITH
CHAPTER 19 BUILDING A BETTER WINDOW WITH SYSTEM.618 STEM.WINDOWS.FORMS The Functionality of the Form Class The Form class is typically (but not necessarily) the direct base class for your custom Form types. In addition to the large set of members inherited from the Control, ScrollableControl, and ContainerControl classes, the Form type adds additional functionality in particular to main windows, MDI child windows, and dialog boxes. Let s start with the core properties in Table 19-8. Table 19-8. Properties of the Form Type Properties Meaning in Life AcceptButton Gets or sets the button on the Form that is clicked when the user presses the Enter key. ActiveMDIChild Used within the context of an MDI application. IsMDIChild IsMDIContainer CancelButton Gets or sets the button control that will be clicked when the user presses the Esc key. ControlBox Gets or sets a value indicating whether the Form has a control box. FormBorderStyle Gets or sets the border style of the Form. Used in conjunction with the FormBorderStyle enumeration. Menu Gets or sets the menu to dock on the Form. MaximizeBox Used to determine if this Form will enable the maximize and minimize MinimizeBox boxes. ShowInTaskbar Determines if this Form will be seen on the Windows taskbar. StartPosition Gets or sets the starting position of the Form at runtime, as specified by the FormStartPosition enumeration. WindowState Configures how the Form is to be displayed on startup. Used in conjunction with the FormWindowState enumeration. In addition to the expected On-prefixed default event handlers, Table 19-9 gives a list of some core methods defined by the Form type. Table 19-9. Key Methods of the Form Type Method Meaning in Life Activate() Activates a given Form and gives it focus. Close() Closes a Form. CenterToScreen() Places the Form in the dead-center of the screen. LayoutMDI() Arranges each child Form (as specified by the LayoutMDI enumeration) within the parent Form. ShowDialog() Displays a Form as amodal dialog box. More on dialog box programming in Chapter 21. Finally, the Form class defines a number of events, many of which fire during the form s lifetime. Table 19-10 hits the highlights.
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.