From Clomosy Docs
It is a mechanism for customizing the appearance and behavior of a form. TclStyleForm customizes the form's background, border style, title bar, and other elements of its appearance.
This class manages user interface elements and themes to provide a modern and sleek look.
Before using these features, the form must be initialized.
An object of the TclStyleForm class should be defined.
var StyleForm1 : TclStyleForm;
The defined object must be created using the "Create" function.
{
StyleForm1 = TclStyleForm.Create(Self);
StyleForm1.Run;
}
To set the theme color to dark or light, the clSetStyle property should be used.
StyleForm1.clSetStyle(StyleForm1.DarkSB); //StyleForm1.LightSB
Example 1
var
StyleForm1:TclStyleForm;
{
StyleForm1 = TclStyleForm.Create(Self);
StyleForm1.Run;
}
Example 2
var
MyForm:TclStyleForm;
BtnSample:TclButton;
MyVertBox:TClVertScrollBox;
MyExpander1, MyExpander2:TclExpander;
MyLayout1, MyLayout2:TclLayout;
MyLabel1, MyLabel2:TclLabel;
void BtnSampleClick;
{
MyExpander1.IsExpanded = Not MyExpander1.IsExpanded;
MyExpander2.IsExpanded = Not MyExpander2.IsExpanded;
}
{
MyForm = TclStyleForm.Create(Self);
MyForm.clSetStyle(MyForm.DarkSB);
BtnSample= MyForm.AddNewButton(MyForm,'BtnSample','Click Me!');
BtnSample.Align = alTop;
MyForm.AddNewEvent(BtnSample,tbeOnClick,'BtnSampleClick');
MyVertBox= MyForm.AddNewVertScrollBox(MyForm,'MyVertBox');
MyVertBox.Align = alClient;
MyExpander1= MyForm.AddNewExpander(MyVertBox,'MyExpander1','');
MyExpander1.Align = alTop;
MyExpander1.Height = 100;
MyExpander1.IsExpanded = False;
MyLayout1= MyForm.AddNewLayout(MyExpander1,'MyLayout1');
MyLayout1.Align = alClient;
MyLabel1= MyForm.AddNewLabel(MyLayout1,'MyLabel1','My Expander Label Caption');
MyLabel1.Align = alTop;
MyExpander2= MyForm.AddNewExpander(MyVertBox,'MyExpander2','');
MyExpander2.Align = alTop;
MyExpander2.Height = 100;
MyLayout2= MyForm.AddNewLayout(MyExpander2,'MyLayout2');
MyLayout2.Align = alClient;
MyLabel2= MyForm.AddNewLabel(MyLayout2,'MyLabel2','My Expander Label Caption 2');
MyLabel2.Align = alTop;
MyForm.Run;
}