[]
IButton, ICellLinkControl, ICellLinkControlT<T>, ICheckBox, IContentControl, IControlT<T>, IDropDown, IGroupBox, ILabel, IListBox, IOptionButton, IRangeBase, IScrollBar, ISelector, ISelectorT<T,TCollection> , ISpinnerThis interface defines the common members shared by form controls such as buttons, check boxes, drop-down lists, labels, and scroll bars. Use it to access shared control state and behavior, including the parent object, control type, position, size, visibility, printing, and locking settings.
The parent object is typically an IWorksheet, but in some cases it can be another IControl.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
FormControlType type = control.getFormControlType();
Object parent = control.getParent();
control.setEnabled(false);
booleanvoiddelete()booleandoubledoublegetLeft()booleangetName()IWorksheet.booleandoublegetTop()booleandoublegetWidth()intbooleanvoidsetEnabled(boolean value) voidsetHeight(double value) voidsetLeft(double value) voidsetLocked(boolean value) voidvoidsetPlacement(Placement value) voidsetPrintObject(boolean value) voidsetTop(double value) voidsetVisible(boolean value) voidsetWidth(double value) IWorksheet. In some cases, the type of this property is IControl.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
IWorksheet parentWorksheet = (IWorksheet) control.getParent();
IWorksheet; in some cases, returns an IControl.Use the returned FormControlType value to identify the concrete kind of control represented by this IControl, such as a button, check box, drop-down list, label, or scroll bar.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
FormControlType type = control.getFormControlType();
FormControlType value that identifies this control.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setEnabled(false);
boolean enabled = control.getEnabled();
true if the control is enabled; otherwise, false.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setEnabled(false);
value - true if the control is enabled; otherwise, false.Use this method to retrieve the current height of a form control, such as after creating it or changing it with setHeight(double).
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setHeight(40);
double height = control.getHeight();
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setHeight(40);
value - The height of this control.Use this method to retrieve the current horizontal offset of the control.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setLeft(40);
double left = control.getLeft();
Use this method to set the horizontal offset of the control.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setLeft(40);
value - The left margin of this control.Use this method to determine whether the control is configured to reject user input. To change this state, use setLocked(boolean).
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setLocked(true);
boolean locked = control.getLocked();
true if the control is locked; otherwise, false.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setLocked(true);
value - true if the control is locked; otherwise, false.The returned Placement value determines whether the control moves with cells, moves and resizes with cells, or remains free floating.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setPlacement(Placement.Move);
Placement placement = control.getPlacement();
Placement value that specifies how the control is attached to its underlying cells.Use this method to control whether the form control moves or resizes when the underlying cells are moved or resized.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setPlacement(Placement.MoveAndSize);
value - The placement mode to apply, such as Placement.MoveAndSize, Placement.Move, or Placement.FreeFloating.Use this property to determine whether the control is included when the worksheet is printed.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setPrintObject(false);
boolean printObject = control.getPrintObject();
true if the control will be printed; otherwise, false.Use this property to set whether the control is included when the worksheet is printed.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setPrintObject(false);
value - true if the control will be printed; otherwise, false.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setTop(40);
double top = control.getTop();
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setTop(40);
value - The top margin of this control.Use this property to determine whether the control is currently displayed on the worksheet.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setVisible(false);
boolean visible = control.getVisible();
true if the control is visible; otherwise, false.Use this property to set whether the control is currently displayed on the worksheet.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setVisible(false);
value - true if the control is visible; otherwise, false.Use this method to retrieve the current width after the control is created or resized by setWidth(double).
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setWidth(160.0);
double width = control.getWidth();
Use this method to set the width after the control is created or resized by IControl#setWidth(double).
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setWidth(160.0);
value - The current width of this control.Use this method to retrieve the stacking position of the control relative to other controls on the worksheet. The returned value can change after calling bringToFront() or sendToBack().
IControl control1 = worksheet.getControls().addButton(20, 20, 120, 30);
IControl control2 = worksheet.getControls().addButton(40, 40, 120, 30);
control2.bringToFront();
int zOrder = control2.getZOrder();
Returns the IShapeRange associated with the control so you can access the underlying shape objects.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
IShapeRange shapeRange = control.getShapeRange();
int count = shapeRange.getCount();
IShapeRange that contains the shapes of this control.Use this method to place the control in front of other overlapping form controls on the same parent.
IButton button1 = worksheet.getControls().addButton(20, 20, 80, 24);
IButton button2 = worksheet.getControls().addButton(30, 24, 80, 24);
boolean moved = button1.bringToFront();
true if the control is brought to the front; otherwise, false.Use this method to remove the current control from its parent object, such as a worksheet or another control container.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setName("submitButton");
control.delete();
Use this method to place the control behind other overlapping form controls on the same parent.
IControl control1 = worksheet.getControls().addButton(20, 20, 120, 30);
IControl control2 = worksheet.getControls().addButton(30, 24, 120, 30);
boolean moved = control2.sendToBack();
true if the control's z-order position changes successfully; otherwise, false.Returns the worksheet cell at the lower-right corner of the area occupied by the control.
IButton button = worksheet.getControls().addButton(20, 20, 80, 24);
IRange cell = button.getBottomRightCell();
String address = cell.getAddress();
Use this method to retrieve the identifier assigned to the control, for example after calling setName(String).
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setName("SubmitButton");
String name = control.getName();
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
control.setName("SubmitButton");
value - The name of this control.The returned IRange identifies the worksheet cell at the upper-left corner of the control.
IControl control = worksheet.getControls().addButton(20, 20, 120, 30);
IRange cell = control.getTopLeftCell();
String address = cell.getAddress();