# CheckboxNode
Class Inherits FormControlNode
## About
`CheckboxNode` represents a checkbox with an accompanying editable label. It supports checked and default-checked state, submitted value, name, disabled state, and the other shared field attributes.
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| ActionItem | index As Integer | ToolbarItem | Returns the contextual toolbar item at the specified index. |
| AddVectorPDFAnnotations | pdf As PDFDocument <br> pageNumber As Integer <br> offsetX As Double <br> offsetY As Double <br> usedNames As Dictionary <br> formAction As String = "" | (None) | Adds this node's interactive annotations and form controls to a vector PDF page. Override for custom nodes. |
| CanImportHTML | element As HTMLSupport.HTMLElement | Boolean | Returns whether this node can import the supplied HTML element. |
| Constructor | caption As String = "" | (None) | Creates a new checkbox node. |
| Duplicate | (None) | Node | Returns an indepent copy of this node. |
| FromHTML | element As HTMLSupport.HTMLElement | Boolean | Imports a checkbox input element. |
| FromJSON | data As JSONItem | Boolean | Restores state from JSON. |
| HandlePress | x As Double <br> y As Double | Boolean | Toggles the checkbox when the user presses its box. |
| HTMLImportPriority | element As HTMLSupport.HTMLElement | Integer | Returns the checkbox importer priority so a wrapping label becomes one control node. |
| HTMLTags | (None) | String | Returns the HTML tag names supported by this node type. |
| InspectorSections | (None) | InspectorSection | Returns the user-editable checkbox properties exposed by the inspector. |
| LastActionIndex | (None) | Integer | Returns the last zero-based action index supplied by this node, or -1 when there are no actions. |
| LocalizeToolbarItem | strings As GraffitiProEditor.Editor | (None) | Sets this node type's toolbar item text from the supplied editor's localization properties. The editor calls it when the type is registered, when the editor opens, and when a locale pack is applied to the editor. A custom node type can override it to localize its own toolbar item. |
| PerformAction | index As Integer <br> selectedItem As DesktopMenuItem | (None) | Handles the contextual toolbar action. |
| PerformToolbarAction | editor As Editor <br> selectedItem As DesktopMenuItem | (None) | Handles activation of the main-toolbar item. |
| PreferredHeight | g As Graphics <br> availableWidth As Double | Double | Returns the preferred height. |
| Render | g As Graphics <br> bounds As Rect <br> selected As Boolean | (None) | Draws the checkbox preview. |
| SupportsTextAlignment | (None) | Boolean | Returns whether the node draws text that follows its TextAlignment. |
| ToHTML | (None) | String | Returns an HTML representation of this content. |
| ToJSON | (None) | JSONItem | Returns the persistent state as JSON. |
| TypeName | (None) | String | Returns the display name. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| Caption | String | (None) | Gets or sets the user-visible caption. |
| Checked | Boolean | (None) | Gets or sets whether the control is checked. |
| Indeterminate | Boolean | (None) | Gets or sets the runtime-only indeterminate state; this is not an HTM attribute. |
| Required | Boolean | (None) | Gets or sets whether the control is required. |
| Value | String | (None) | Gets or sets the submitted value. |
## Notes
The checkbox indicator and its accompanying label are one node.
### JSON Format
`caption` and `value` are strings. `checked`, `indeterminate`, and `required` are Boolean. The editable caption's rich-text state is inherited from `TextNode`; common form attributes are inherited from `FormControlNode`.
`caption` and `value` are omitted when empty, and `checked`, `indeterminate`, and `required` when `False`; missing names restore those defaults.
### Label and State
The visible label is part of the checkbox node and is preserved in HTML as a proper accompanying label. Editing and text styling apply to the label while clicking the checkbox indicator changes the control's default state.