Skip to main content

TcxEditStyleController Class

A style controller that defines state appearance settings common to multiple editors.

Declaration

TcxEditStyleController = class(
    TcxStyleController
)

Remarks

A style controller is a non-visual component that stores appearance settings of individual states (normal, focused, read-only, etc.) for multiple editors. To associate a style controller with an editor, assign a TcxEditStyleController object to the editor’s Style.StyleController property.

Tip

If you need to override global appearance settings for all editors in the application, use the TcxDefaultEditStyleController component.

Main API Members

The list below outlines key members of the TcxEditStyleController class. These members allow you to customize editor appearance.

Style | StyleDisabled | StyleFocused | StyleHot | StyleReadOnly
Allow you to define individual appearance settings for different states of all editors associated with the style controller. Corresponding appearance settings of associated editors have higher priority than these style controller settings.
Styles
Provides access to individual styles applied to editors in different states.
RestoreStyles
Restores all default style settings for all editor states.

Code Example: Override Global Appearance Settings for Multiple Editors

The following code example uses a TcxEditStyleController component to override a global skin for three spin editors:

uses
  cxEdit,  // Declares the TcxEditStyleController class
  cxSpinEdit, // Declares the TcxSpinEdit class
  cxTextEdit,  // Declares the TcxTextEdit class
  dxSkinsForm; // Declares the TdxSkinController class
// ...

procedure TMyForm.FormCreate(Sender: TObject);
begin
  dxSkinController1.SkinName := 'WXICompact';  // Specifies a skin at the global level
  // Specify a different skin for an edit style controller component
  cxEditStyleController1.Style.LookAndFeel.SkinName := 'Office2019Black';
  // Associate a style controller with three spin editors
  cxSpinEdit1.Style.StyleController := cxEditStyleController1;
  cxSpinEdit2.Style.StyleController := cxEditStyleController1;
  cxSpinEdit3.Style.StyleController := cxEditStyleController1;
end;

VCL Editors Library: Global Skin Override for Multiple Editors

Direct TcxEditStyleController Class References

The following public API members reference a TcxEditStyleController object:

TcxCustomEditStyle.ActiveStyleController
Provides access to the source of default editor appearance settings.
TcxCustomEditStyle.StyleController
Identifies the style controller for the current TcxCustomEditStyle object.
See Also