SetRect
Sets field rect.
Syntax
expression.SetRect(rect);
expression - A variable that represents a ApiBaseWidget class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| rect | Required | Rect | No description provided. |
Returns
boolean
Example
This example create a new field and sets new rect to its widget.
- Code
- Result
let doc = Api.GetDocument();
let page = doc.GetPage(0);
let textField = Api.CreateTextField([10, 10, 160, 30]);
page.AddObject(textField);
let widgets = textField.GetAllWidgets();
widgets[0].SetRect([30, 30, 160, 60]);