vcl-cxcontainer-dot-tcxcontainerstyle-c2ff829a.md
Specifies the source of style settings.
property StyleController: TcxStyleController read; write;
| Type | Description |
|---|---|
| TcxStyleController |
The source style controller component.
|
You can use the StyleController property to associate the base style with a style controller component (a TcxStyleController descendant instance).
Tip
You can use the Style.StyleController property to associate a style controller with another style controller.
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;
#include "cxEdit.hpp" // Declares the TcxEditStyleController class
#include "cxSpinEdit.hpp" // Declares the TcxSpinEdit class
#include "cxTextEdit.hpp" // Declares the TcxTextEdit class
#include "dxSkinsForm.hpp" // Declares the TdxSkinController class
// ...
void __fastcall TMyForm::FormCreate(TObject *Sender)
{
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;
}
See Also