跳到主要内容

SetPlaceholderText

设置当前内容控件的占位符文本。

语法

expression.SetPlaceholderText(text);

expression - 表示 ApiBlockLvlSdt 类的变量。

参数

名称必需/可选数据类型默认值描述
text必需string将设置到当前内容控件的文本。

返回值

boolean

示例

向文档中的空内容控件添加占位符文本。

// How do I set hint text that appears inside an unfilled content control in a document?

// Guide users with a prompt message shown inside a blank content control in a document.

let doc = Api.GetDocument();
let blockLvlSdt = Api.CreateBlockLvlSdt();
doc.AddElement(0, blockLvlSdt);
blockLvlSdt.SetPlaceholderText("Enter your name here");