, ,

Using the SetCellColor method

SetCellColor is used to dynamically change the cell color of a control using scripting. To call the method:

Code

form.GetControl(“ControlName”).SetCellColor(“ColorCode“);

 

where ControlName is the name of the control whose cell color you want to change and ColorCode is the HTML color’s code representation.

 

For example, let’s assume we have a TextBox control called c_Country and a Button control, c_Control4 with an action script used to dynamically change the textbox’s cell color to purple.

The Button’s custom script:

 

The actual code:

Code

form.GetControl(“c_Country”).SetCellColor(“#8467D7”);

 

The Textbox before pressing the Button:

 

The Textbox after pressing the Button: