[]
ICellLinkControl, ICellLinkControlT<Boolean>, IContentControl, IControl, IControlT<IOptionButton>An option button lets users select a single choice from a group of mutually exclusive options. Option buttons are grouped by the containing IGroupBox. Option buttons in the same group share the linked cell value and update each other's selection state. If an option button is not contained in any group box, it belongs to the default group on the worksheet.
IGroupBox groupBox = worksheet.getControls().addGroupBox(20, 20, 120, 80);
groupBox.setText("Shipping");
IOptionButton standard = worksheet.getControls().addOptionButton(30, 40, 90, 18);
standard.setText("Standard");
standard.setLinkedCell(worksheet.getRange("B1"));
standard.setIsChecked(true);
booleanIOptionButton is checked.voidsetIsChecked(boolean value) IOptionButton is checked.getDisplay3DShading, getLinkedCell, setDisplay3DShading, setLinkedCellgetValue, setValuegetLockedText, getText, setLockedText, setTextbringToFront, delete, getBottomRightCell, getEnabled, getFormControlType, getHeight, getLeft, getLocked, getName, getParent, getPlacement, getPrintObject, getShapeRange, getTop, getTopLeftCell, getVisible, getWidth, getZOrder, sendToBack, setEnabled, setHeight, setLeft, setLocked, setName, setPlacement, setPrintObject, setTop, setVisible, setWidthOption buttons in the same group box are in the same group. If this method returns null, the option button belongs to the default group.
Option buttons in the same group share the value of the ICellLinkControl.LinkedCell property. They also affect the selection state of other option buttons in the same group.
IOptionButton optionButton = worksheet.getControls().addOptionButton(22.2, 24.6, 109.2, 16.8);
IGroupBox groupBox = worksheet.getControls().addGroupBox(7.8, 6, 196.8, 122.4);
groupBox.setText("Choices");
IGroupBox parentGroup = optionButton.getGroupBox();
String text = parentGroup.getText();
null if the option button is in the default group.IOptionButton is checked.For option buttons in the same group, a checked state indicates the currently selected option in that group.
IOptionButton optionButton = worksheet.getControls().addOptionButton(20, 20, 72, 18);
optionButton.setIsChecked(true);
boolean isChecked = optionButton.getIsChecked();
false if the option button is unchecked; otherwise, true.IOptionButton is checked.For option buttons in the same group, a checked state indicates the currently selected option in that group.
IOptionButton optionButton = worksheet.getControls().addOptionButton(20, 20, 72, 18);
optionButton.setIsChecked(true);
value - False - Unchecked, true - Checked.