Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxStyle Class

Specifies style attributes for an element of some control.

#Declaration

Delphi
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