Microsoft.Common.CheckBox UI 元素Microsoft.Common.CheckBox UI element

CheckBox 控件允许用户检查或不检查某选项。The CheckBox control lets users check or uncheck an option. 检查了控件后,控件返回“true”,未检查时返回“false” 。The control returns true when the control is checked or false when not checked.

UI 示例UI sample

Microsoft.Common.CheckBox

架构Schema

{
    "name": "legalAccept",
    "type": "Microsoft.Common.CheckBox",
    "label": "I agree to the terms and conditions.",
    "constraints": {
        "required": true,
        "validationMessage": "Please acknowledge the legal conditions."
    }
}

示例输出Sample output

true

备注Remarks

将“必需”设置为“true”时,用户必须选中该复选框 。When you set required to true, the user must select the checkbox. 如果用户未选中该复选框,会显示验证消息。If the user doesn't select the checkbox, the validation message is displayed.

后续步骤Next steps