How to: Create a Checkbox Form Field in Rich Text Editor for WPF
- 2 minutes to read
The RichEditControl allows you to view and export a document containing checkbox form fields. These form fields are interactive, so end-users can toggle their state as needed. The resulting document can be exported to PDF or HTML format.
Important
Rich
#Checkboxes in API
Use members from the table below to manage checkboxes in code.
API | Description |
---|---|
Inserts a checkbox form field to a given document position and adds the created Check | |
Specifies a bookmark name associated with the checkbox. | |
Gets or sets the checkbox’s state. | |
Defines the checkbox’s size mode. Use the Check | |
Specifies the type of instructional text that accompanies the checkbox. | |
Gets or sets the checkbox’s instructional text. With the …Text |
using DevExpress.XtraRichEdit.API.Native;
//...
DocumentPosition currentPosition = document.CaretPosition;
CheckBox checkBox = document.FormFields.InsertCheckBox(currentPosition);
checkBox.Name = "check1";
checkBox.State = CheckBoxState.Checked;
checkBox.SizeMode = CheckBoxSizeMode.Auto;
checkBox.HelpTextType = FormFieldTextType.Custom;
checkBox.HelpText = "help text";
#Checkboxes in the User Interface
End-users can change the checkbox’s state by double-clicking the object. The state defined by an end-user is passed to the CheckBox.DefaultState property.
Note
Rich
- It does not provide user interface elements to manage checkboxes.
- It cannot display instructional text provided for the checkbox.
- It does not support macros assigned with the checkbox.