DocumentBuilderInsertCheckBox Method (String, Boolean, Boolean, Int32)
Inserts a checkbox form field at the current position.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.10
Syntax
public FormField InsertCheckBox(
	string name,
	bool defaultValue,
	bool checkedValue,
	int size
)

Parameters

name
Type: SystemString
The name of the form field. Can be an empty string. The value longer than 20 characters will be truncated.
defaultValue
Type: SystemBoolean
Default value of the checkbox form field.
checkedValue
Type: SystemBoolean
Current checked status of the checkbox form field.
size
Type: SystemInt32
Specifies the size of the checkbox in points. Specify 0 for MS Word to calculate the size of the checkbox automatically.

Return Value

Type: FormField
The form field node that was just inserted.
Remarks

If you specify a name for the form field, then a bookmark is automatically created with the same name.

Examples
Shows how to insert checkboxes to the document
[C#]

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.InsertCheckBox(String.Empty, false, false, 0);
builder.InsertCheckBox("CheckBox_Default", true, true, 50);
builder.InsertCheckBox("CheckBox_OnlyCheckedValue", true, 100);
See Also