ToFixed
Converts the current form to a fixed size form.
Inherited from ApiFormBase.ToFixed.
Syntax
expression.ToFixed(width, height, keepPosition);
expression - A variable that represents an ApiComboBoxForm class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| width | Required | twips | The wrapper shape width measured in twentieths of a point (1/1440 of an inch). | |
| height | Required | twips | The wrapper shape height measured in twentieths of a point (1/1440 of an inch). | |
| keepPosition | Required | boolean | Save position on the page (it can be a little bit slow, because it runs the document calculation). |
Returns
boolean
Example
Convert a combo box form to a fixed size in a document.
// How do I give a combo box form a fixed size in a document?
// Lock the dimensions of a combo box so it does not resize when content changes in a document.
let doc = Api.GetDocument();
let comboBoxForm = Api.CreateComboBoxForm({"key": "Personal information", "tip": "Choose your country", "required": true, "placeholder": "Country", "editable": false, "autoFit": false, "items": ["Latvia", "USA", "UK"]});
let paragraph = doc.GetElement(0);
paragraph.AddElement(comboBoxForm);
comboBoxForm.ToFixed(7 * 240, 2 * 240);
let isFixed = comboBoxForm.IsFixed();
paragraph = Api.CreateParagraph();
paragraph.AddText("The first form from this document has a fixed size: " + isFixed);
doc.Push(paragraph);