SetControlsHighlight
Sets the highlight to the content controls from the current document.
Syntax
expression.SetControlsHighlight(r, g, b, bNone);
expression - A variable that represents a ApiDocument class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| r | Required | byte | Red color component value. | |
| g | Required | byte | Green color component value. | |
| b | Required | byte | Blue color component value. | |
| bNone | Optional | boolean | false | Defines that highlight will not be set. |
Returns
boolean
Example
This example sets the highlight to the content controls from the document.
- Code
- Result
// How to highlight thw controls with rose color.
// Add elements to the document and color their background.
let doc = Api.GetDocument();
let blockLvlSdt = Api.CreateBlockLvlSdt();
blockLvlSdt.GetContent().GetElement(0).AddText("This is a block text content control.");
doc.AddElement(0, blockLvlSdt);
doc.SetControlsHighlight(255, 111, 61);