CheckBoxControl class
CheckBoxControl class
The CheckBox control toggles a value.
Remarks
It has three possible states: selected, cleared, and neither selected nor cleared, meaning a combination of on and off states.
Inheritance: CheckBoxControl → MorphDataControl → Forms2OleControl → OleControl
Properties
| Name | Description |
|---|---|
| back_color | Gets or sets a background color of the control. The default value depends on a type of the control. (Inherited from Forms2OleControl) |
| caption | Gets or sets a Caption property of the control. Default value is an empty string. (Inherited from Forms2OleControl) |
| checked | Gets or sets a boolean value indicating either this CheckBoxControl is checked or not. The default value is False. |
| child_nodes | Gets collection of immediate child controls. (Inherited from Forms2OleControl) |
| enabled | Returns True if control is in enabled state.(Inherited from Forms2OleControl) |
| fore_color | Gets or sets a foreground color of the control. The default value depends on a type of the control. (Inherited from Forms2OleControl) |
| group_name | Gets or sets a string that specifies a group of mutually exclusive controls. The default value is an empty string. (Inherited from Forms2OleControl) |
| height | Gets or sets a height of the control in points. (Inherited from Forms2OleControl) |
| is_forms2_ole_control | Returns True if the control is a Forms2OleControl.(Inherited from OleControl) |
| name | Gets or sets name of the ActiveX control. (Inherited from OleControl) |
| type | Gets type of Forms 2.0 control. |
| value | Gets underlying Value property which often represents control state. For example checked option button has ‘1’ value while unchecked has ‘0’. Default value is an empty string. (Inherited from Forms2OleControl) |
| width | Gets or sets a width of the control in points. (Inherited from Forms2OleControl) |
Methods
| Name | Description |
|---|
Examples
Shows how to change state of the CheckBox control.
doc = aw.Document(file_name=MY_DIR + 'ActiveX controls.docx')
shape = doc.get_child(aw.NodeType.SHAPE, 0, True).as_shape()
check_box_control = shape.ole_format.ole_control.as_check_box_control()
check_box_control.checked = True
self.assertEqual(True, check_box_control.checked)
self.assertEqual(aw.drawing.ole.Forms2OleControlType.CHECK_BOX, check_box_control.type)
See Also
- module aspose.words.drawing.ole
- class MorphDataControl