Skip to main content

SetCheckBoxChecked

Sets the checkbox value for the content control. This method updates the checkbox state of the content control to either checked or unchecked.

Syntax

expression.SetCheckBoxChecked(isChecked);

expression - A variable that represents a ApiInlineLvlSdt class.

Parameters

NameRequired/OptionalData typeDefaultDescription
isCheckedRequiredbooleanThe state to set for the checkbox. true for checked, false for unchecked.

Returns

boolean

Example

Mark a checkbox content control as checked in a document.

// How do I programmatically check or uncheck a checkbox control in a document?

// Pre-fill a form by setting a checkbox to its checked state before the user opens it in a document.

let doc = Api.GetDocument();
let inlineControl = doc.AddCheckBoxContentControl();
inlineControl.SetCheckBoxChecked(true);