Jetty web server - CHAPTER 19 BUILDING A BETTER WINDOW WITH
CHAPTER 19 BUILDING A BETTER WINDOW WITH SYSTEM.WINDOWS.FORMS 613 Table 19-4. Core Properties of the Control Type Properties Meaning in Life BackColor, ForeColor, These properties define the core UI of the control (colors, BackgroundImage, Font, Cursor font for text, mouse cursor to display when the mouse is over the widget, etc.). Anchor, Dock, AutoSize These properties control how the control should be positioned within the container. Top, Left, Bottom, Right, Bounds, These properties specify the current dimensions of the ClientRectangle, Height, Width control. Enabled, Focused, Visible These properties each return a Boolean that specifies the state of the current control. ModifierKeys This static property checks the current state of the modifier keys (Shift, Ctrl, and Alt) and returns the state in a Keys type. MouseButtons This static property checks the current state of the mouse buttons (left, right, and middle mouse buttons) and returns this state in a MouseButtons type. TabIndex, TabStop These properties are used to configure the tab order of the control. Opacity This property determines the opacity of the control, in fractions (0.0 is completely transparent; 1.0 is completely opaque). Text This property indicates the string data associated with this control. Controls This property allows you to access a strongly typed collection (ControlsCollection) that contains any child controls within the current control. As you would guess, the Control class also defines a number of events that allow you to intercept mouse, keyboard, painting, and drag-and-drop activities (among other things). Table 19-5 lists some (but not all) events of interest, grouped by related functionality. Table 19-5. Events of the Control Type Events Meaning in Life Click, DoubleClick, MouseEnter, Various events that allow you to interact with the mouse MouseLeave, MouseDown, MouseUp, MouseMove, MouseHover, MouseWheel KeyPress, KeyUp, KeyDown Various events that allow you to interact with the keyboard DragDrop, DragEnter, Various events used to monitor drag-and-drop activity DragLeave, DragOver Paint This event allows you to interact with GDI+ (see Chapter 20) Finally, the Control base class also defines a number of methods that allow you to interact with any Control-derived type. As you examine the methods of the Control type, you will notice that a good number of them have an On prefix followed by the name of a specific event (OnMouseMove, OnKeyUp, OnPaint, etc.). Each of these On-prefixed virtual methods is the default event handler for its respective event. If you override any of these virtual members, you gain the ability to perform any necessary pre- or postprocessing of the event before (or after) invoking your parent s default implementation:
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.