SetPosition
Sets widget position.
Syntax
expression.SetPosition(position);
expression - A variable that represents a ApiBaseWidget class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| position | Required | Point | No description provided. |
Returns
boolean
Example
This example create a new field and sets new position 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].SetPosition({x: 30, y: 30});