[]
Represents the collection of form controls in a worksheet.
Use this interface to access, add, and enumerate worksheet form controls such as buttons, check boxes, labels, drop-down lists, and other supported control types. Controls can be retrieved by zero-based index or by name, and the collection can be enumerated because it implements IReadOnlyList<T>.
public interface IControlCollection : IReadOnlyList<IControl>, IReadOnlyCollection<IControl>, IEnumerable<IControl>, IEnumerable
Public Interface IControlCollection
Inherits IReadOnlyList(Of IControl), IReadOnlyCollection(Of IControl), IEnumerable(Of IControl), IEnumerable
IControlCollection controls = worksheet.Controls;
IButton button = controls.AddButton(20, 20, 100, 24);
button.Name = "submitButton";
IControl control = controls["submitButton"];
| Name | Description |
|---|---|
| this[string] | Gets control by name. Use this indexer to retrieve a control from the collection by its name. |
| Name | Description |
|---|---|
| AddButton(double, double, double, double) | Adds a new Creates a button control at the specified position and size in the worksheet's control collection. |
| AddCheckBox(double, double, double, double) | Adds a new Creates a check box form control in the worksheet at the specified position and size, and returns the created control for further configuration. |
| AddDropDown(double, double, double, double) | Adds a new IDropDown. Creates a drop-down form control at the specified position with the specified size on the worksheet. Use the returned control to add items, bind a linked cell, or set the selected item. |
| AddGroupBox(double, double, double, double) | Adds a new Creates a group box control at the specified location and size on the worksheet. A group box can be used to organize related controls, such as IOptionButton controls. |
| AddLabel(double, double, double, double) | Adds a new Use this method to place a label control on the worksheet by specifying its position and size. |
| AddListBox(double, double, double, double) | Adds a new Use the returned list box to add selectable items or link the control to a worksheet cell. |
| AddOptionButton(double, double, double, double) | Adds a new Creates an option button control at the specified location and size and returns the created control. Option buttons placed inside the bounds of the same IGroupBox participate in the same selection group; otherwise, they belong to the worksheet's default group. |
| AddScrollBar(double, double, double, double) | Adds a new Creates a scroll bar control on the worksheet at the specified position and size, and returns the newly added control. |
| AddSpinner(double, double, double, double) | Adds a new Use this method to place a spinner form control on the worksheet and then configure its linked cell and range settings through the returned ISpinner. |
| Clear() | Removes all controls from a After this method is called, the collection is empty. |
| IndexOf(IControl) | Gets the index of a control. Returns the zero-based position of the specified control in this collection. |