From Clomosy Docs

Revision as of 12:52, 6 November 2024 by ClomosyManager (talk | contribs)

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 component. This function allows you to assign a value to a specific property of a component at runtime.

The general usage is as follows:

Example
TRObject Syntax

 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!');
   clComponent.SetupComponent(iconBtn,'{"Align" : "Top","MarginTop":40,"MarginLeft":5,
   "Height":150}');
   MainForm.AddNewEvent(iconBtn,tbeOnClick,'iconBtnClick');
   
   MainForm.Run;
 }

Base Syntax

 var
   MainForm : TclForm;
   iconBtn : TCLProButton;
 
 procedure iconBtnClick;
 begin
   clRTSetProperty(iconBtn,'Text','Hello World!');
 end;
 
 begin
   MainForm:=TclForm.Create(self);
   MainForm.SetFormBGImage('https://clomosy.com/demos/bg1.png');
   
   iconBtn := MainForm.AddNewProButton(MainForm,'iconBtn','Hello!');
   clComponent.SetupComponent(iconBtn,'{"Align" : "Top","MarginTop":40,"MarginLeft":5,
   "Height":150}');
   MainForm.AddNewEvent(iconBtn,tbeOnClick,'iconBtnClick');
   
   MainForm.Run;
 end;

See Also