跳到主要内容

SetPlaceholder

设置文本字段占位符。

备注

使组合框可编辑

语法​

expression.SetPlaceholder(sPlaceholder);

expression - 表示 ApiComboboxField 类的变量。

参数​

名称必需/可选数据类型默认值描述
sPlaceholder必需string字段占位符

返回值​

boolean

示例​

在 PDF 中为组合框字段添加在输入前显示的提示文本。

// Useful for adding a hint text to an empty combobox field in a PDF.

// Configure what example text shows when a combobox field is empty in a PDF.

let doc = Api.GetDocument();
let page = doc.GetPage(0);
let comboboxField = Api.CreateComboboxField([10, 10, 160, 30]);
page.AddObject(comboboxField);

comboboxField.SetPlaceholder("Your text here");