Vcl.Controls.TControl.ControlStyle

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property ControlStyle: TControlStyle read FControlStyle write FControlStyle;

C++

__property TControlStyle ControlStyle = {read=FControlStyle, write=FControlStyle, nodefault};

Properties

Type Visibility Source Unit Parent
property public
Vcl.Controls.pas
Vcl.Controls.hpp
Vcl.Controls TControl

Description

Determines style characteristics of the control.

Use ControlStyle to determine various attributes of the control, such as whether the control can capture the mouse or has a fixed size. The ControlStyle property contains a set of style flags indicating these attributes. The following table lists the flags and their meanings:



Flag Meaning

csAcceptsControls

The control becomes the parent of any controls dropped on it at design time.

csCaptureMouse

The control captures mouse events when it is clicked.

csDesignInteractive

The control maps right mouse button clicks at design time into left mouse button clicks to manipulate the control.

csClickEvents

The control can receive and respond to mouse clicks. Some controls may not inherit this attribute, for example, TButton.

csFramed

The control has a 3D frame.

csSetCaption

The control's Caption should match the Name if it has not been explicitly set to something else.

csOpaque

The control completely fills its client rectangle.

csDoubleClicks

The control can receive and respond to double-click messages. Otherwise, map double-clicks into clicks.

csFixedWidth

The width of the control does not vary or scale.

csFixedHeight

The height of the control does not vary or scale.

csNoDesignVisible

The control is not visible at design time.

csReplicatable

The control can be copied using the PaintTo method to draw its image to an arbitrary canvas.

csNoStdEvents

Standard events such as mouse, key, and click events are ignored. This flag allows an application to run faster when there is no need to respond to these events.

csDisplayDragImage

If a control that has an associated drag image list is dragged across a control with this setting, then the image list is used to enhance the drag cursor while the cursor is over it. Otherwise, the drag cursor is used on its own.

csReflector

The control responds to Windows dialog messages, focus messages, or size change messages. Use this setting if the control can be used as an ActiveX control, so that it receives notification of these events.

csActionClient

The control is linked to an action object. This flag is set when the Action property is set, and cleared if the Action property is cleared.

csMenuEvents

The control responds to system menu commands.



ControlStyle describes all controls instantiated from a given class. ControlStyle should not be modified at run time, except in the constructor. The ControlState property records transient conditions.

The TControl constructor initializes ControlStyle to the set of csCaptureMouse, csClickEvents, csSetCaption, and csDoubleClicks.

ControlStyle is primarily used by component writers when implementing components derived from TControl.

See Also