Skip to main content
A newer version of this page is available. .

TcxStyle Class

Specifies style attributes for an element of some control.

Declaration

TcxStyle = class(
    TcxCustomStyle
)

Remarks

TcxStyle declares properties controlling the appearance of a control element. These attributes are background color, font details and text color. The AssignedValues property determines whether to use these attributes when rendering control elements. When you assign a specific style attribute, the corresponding flag is set in AssignedValues.

Controls usually have to publish styles for several elements such as background, buttons, panels, etc. In this case, controls can declare a class derived from the TcxStyles class publishing specific style properties. Each property of this type represents an object of the TcxStyle class. It is possible to assign the same styles to multiple properties. When any attribute of a particular style is changed, all TcxStyles objects owning a property with this style assigned receive notification and update the corresponding control elements.

You can use a style repository (TcxStyleRepository) to create and store individual styles. When a repository is destroyed, it deletes all styles it owns. The StyleRepository property indicates the repository object which owns the current style.

See Also