Skip to main content

TcxStyleRepository Class

An object managing collections of styles and style sheets.

Declaration

TcxStyleRepository = class(
    TcxScalableComponent
)

Remarks

A style repository represents organized storage of styles applicable to Developer Express controls supporting Styles technology. The TcxStyleRepository class allows you to create, store and access individual styles where each is presented by the TcxCustomStyle class (or its descendant). TcxCustomStyle is an abstract class. Use the TcxStyle class to create items in a repository.

Most Developer Express controls supporting Styles technology declare a Styles member. This supports a collection of style properties defining the appearance of particular control elements. Usually you have to create a style, initialize its attributes as appropriate and assign the style to the control’s style property.

Using style sheets is another way of initializing style properties of a control element. A specific style sheet represents a set of styles suitable for a particular control (for instance, a TcxGridTableViewStyleSheet class specify styles for a grid view). Instead of specifying individual styles for a control element, you can assign it a style sheet thus specifying values for all style properties. To assign a style sheet to a control element, use its Styles.StyleSheet property.

You can create a style sheet programmatically using the CreateStyleSheet method. All style sheets are supported by the StyleSheets property.

The style repository editor provides you a convenient way to manipulate styles and style sheets at design time. The next image demonstrates the Style Sheets tab of the style repository editor:

See Also