GetWrapperShape
返回放置表单的形状,用于控制固定大小表单框架的位置和大小。
对于内联表单将返回 null 值。
继承自 ApiFormBase.GetWrapperShape。
语法
expression.GetWrapperShape();
expression - 表示 ApiDateForm 类的变量。
参数
此方法没有任何参数。
返回值
示例
在文档中访问控制日期表单位置和大小的包裹形状。
// How do I get the shape that wraps a fixed-size date form in a document?
// Apply a colored border to the wrapper shape to visually highlight the form's frame.
let doc = Api.GetDocument();
let dateForm = Api.CreateDateForm({"key": "Nowadays", "tip": "Enter current date", "required": true, "placeholder": "Your date here", "format": "mm.dd.yyyy", "lang": "en-US"});
let paragraph = doc.GetElement(0);
paragraph.AddElement(dateForm);
dateForm.ToFixed(10 * 240, 2 * 240);
let shape = dateForm.GetWrapperShape();
let stroke = Api.CreateStroke(36000, Api.CreateSolidFill(Api.RGB(255, 111, 61)));
shape.SetOutLine(stroke);