From Clomosy Docs
procedure clRTSetProperty(Object: TCLComponent; PropName: String; PropValue: Variant);
Object : The name of the component to be processed should be written.
PropName : The name of the component feature you want to get is specified.
PropValue : The new property value is assigned to PropName.
clRTSetProperty is a part of the Clomosy library and is used to set a property of a object. This function allows you to assign a value to a specific property of a component at runtime.
Usage areas:
| Object | Use of | Explanation |
|---|---|---|
| MyForm : TclForm | clRTSetProperty(MyForm, 'BorderStyle', fbsNone); //fbsNone, fbsSingle, fbsSizeable, fbsDialog, fbsToolWindow, fbsSizeToolWin | It is a property that determines the border style of a form (window). This property defines whether the user can resize the window, whether there is a title bar, and how the window will appear. |
| MyForm : TclForm | clRTSetProperty(MyForm,'ClientHeight',200); clRTSetProperty(MyForm,'ClientWidth',200); |
They are properties used to adjust the dimensions of a form's visible (client) area. |
| MyForm : TclForm (or other objects) | clRTSetProperty(MyForm, 'Caption', 'New Caption'); | It is used to change the text displayed on a component (form, button, label, etc.). |
| Btn : TclButton (or other objects) | clRTSetProperty(Btn, 'Visible', True); // or False | The property determines whether a component (form, button, label, panel, etc.) is visible in the user interface. |
| Btn : TclButton (or other objects) | clRTSetProperty(Btn, 'Text', 'New Text'); | It is used to set the text content inside a component (usually components that handle text input or display). |
Example
var
MainForm : TclForm;
iconBtn : TCLProButton;
void iconBtnClick;
{
clRTSetProperty(iconBtn,'Text','Hello World!');
}
{
MainForm =TclForm.Create(self);
MainForm.SetFormBGImage('https://clomosy.com/demos/bg1.png');
iconBtn = MainForm.AddNewProButton(MainForm,'iconBtn','Hello!');
iconBtn.Align = AlTop;
iconBtn.Height = 150;
iconBtn.Margins.Top = 40;
iconBtn.Margins.Left = 5;
MainForm.AddNewEvent(iconBtn,tbeOnClick,'iconBtnClick');
MainForm.Run;
}