[]
IContentControl, IControl, IControlT<IButton>Use this interface to work with button controls that are added through a worksheet's control collection. An IButton supports button-specific settings such as default, cancel, dismiss, and help button behavior, and also inherits common control features from IControlT and text content members from IContentControl.
IButton button = worksheet.getControls().addButton(50, 20, 120, 24);
button.setText("Submit");
button.setDefaultButton(true);
button.setHorizontalTextAlignment(HorizontalAlignment.Center);
booleanbooleanbooleanbooleanvoidsetCancelButton(boolean value) voidsetDefaultButton(boolean value) voidsetDismissButton(boolean value) voidsetHelpButton(boolean value) voidvoidvoidgetLockedText, 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, setWidth
IButton button = worksheet.getControls().addButton(20, 20, 120, 24);
button.setHorizontalTextAlignment(HorizontalAlignment.Center);
HorizontalAlignment alignment = button.getHorizontalTextAlignment();
IButton button = worksheet.getControls().addButton(20, 20, 120, 24);
button.setText("Submit");
button.setHorizontalTextAlignment(HorizontalAlignment.Left);
value - The HorizontalAlignment value to apply to the button text.Use this property to determine how the button text is displayed, such as upward, downward, vertical, horizontal, or automatic.
IButton button = worksheet.getControls().addButton(20, 20, 120, 24);
button.setOrientation(TickLabelOrientation.OrientationVertical);
TickLabelOrientation orientation = button.getOrientation();
Use this method to control how the button text is displayed, such as upward, downward, vertical, or horizontal.
IButton button = worksheet.getControls().addButton(20, 20, 120, 24);
button.setText("Submit");
button.setOrientation(TickLabelOrientation.OrientationHorizontal);
value - The TickLabelOrientation value to apply to the button text. This value must not be null. Unsupported values such as TickLabelOrientation.OrientationAutomatic are not allowed.IllegalArgumentException - if value is not supported.Returns the vertical alignment applied to the button text.
IButton button = worksheet.getControls().addButton(20, 20, 120, 24);
button.setVerticalTextAlignment(VerticalAlignment.Center);
VerticalAlignment alignment = button.getVerticalTextAlignment();
Use this method to align the button text within the button control.
IButton button = worksheet.getControls().addButton(20, 20, 120, 24);
button.setText("Submit");
button.setVerticalTextAlignment(VerticalAlignment.Bottom);
value - The vertical alignment to apply to the button text.Use this property to determine whether the button is configured as a cancel button.
IButton button = worksheet.getControls().addButton(20, 20, 120, 24);
button.setCancelButton(true);
boolean isCancelButton = button.getCancelButton();
true if the button is a cancel button; otherwise, false.Use this property to set whether the button is configured as a cancel button.
IButton button = worksheet.getControls().addButton(20, 20, 120, 24);
button.setCancelButton(true);
value - true if the button is a cancel button; otherwise, false.Use this property to determine whether the button is marked as the default button for the control. This property corresponds to the value set by setDefaultButton(boolean).
IButton button = worksheet.getControls().addButton(50, 20, 120, 24);
button.setText("Submit");
button.setDefaultButton(true);
boolean isDefaultButton = button.getDefaultButton();
true if the button is the default button; otherwise, false.
IButton button = worksheet.getControls().addButton(50, 20, 120, 24);
button.setText("Submit");
button.setDefaultButton(true);
value - true if the button is the default button; otherwise, false.
IButton button = worksheet.getControls().addButton(20, 20, 120, 24);
button.setDismissButton(true);
boolean isDismissButton = button.getDismissButton();
true if the button is a dismiss button; otherwise, false.
IButton button = worksheet.getControls().addButton(20, 20, 120, 24);
button.setDismissButton(true);
value - true if the button is a dismiss button; otherwise, false.Use this property to determine whether the button is configured as a help button. This property corresponds to the value set by setHelpButton(boolean).
IButton button = worksheet.getControls().addButton(50, 20, 120, 24);
button.setHelpButton(true);
boolean isHelpButton = button.getHelpButton();
true if the button is a help button; otherwise, false.
IButton button = worksheet.getControls().addButton(50, 20, 120, 24);
button.setHelpButton(true);
value - true if the button is a help button; otherwise, false.