TControl Branch

From RAD Studio
Jump to: navigation, search

Go Up to Objects, Components, and Controls

The TControl branch consists of components that descend from TControl but not TWinControl. Classes in this branch are controls: visual objects that the user can see and manipulate at run time. All controls have properties, methods, and events in common that relate to how the control looks, such as its position, the cursor associated with the control's window, methods to paint or move the control, and events to respond to mouse actions. Controls in this branch, however, can never receive keyboard input.

Whereas TComponent defines behavior for all components, TControl defines behavior for all visual controls. This includes drawing routines, standard events, and containership.

TControl introduces many visual properties that all controls inherit. These include the Caption, Color, Font, and HelpContext or HelpKeyword. While these properties are inherited from TControl, they are only published - and hence appear in the Object Inspector - for controls to which they are applicable. For example, TImage does not publish the Color property, since its color is determined by the graphic it displays. TControl also introduces the Parent property, which specifies another control that visually contains the control.

Classes in the TControl branch often called graphic controls, because they all descend from TGraphicControl, which is an immediate descendant of TControl. Although these controls appear to the user at run time, graphic controls do not have their own underlying window. Instead, they use their parent's window. It is because of this limitation that graphic controls cannot receive keyboard input or act as a parent to other controls. However, because they do not have their own window, graphic controls use fewer system resources. For details on many of the classes in the TControl branch, see Graphic Controls.

TControl is designed for VCL (Windows-only) applications. Many controls descend from TControl. The Windows-only controls use native Windows APIs in their implementations.

See Also