[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Forms.IControlCollection.IndexOf

IndexOf Method

IndexOf(IControl)

Gets the index of a control.

Returns the zero-based position of the specified control in this collection.

Declaration
int IndexOf(IControl control)
Function IndexOf(control As IControl) As Integer
Parameters
Type Name Description
IControl control

The control to find. If null, this method returns -1.

Returns
Type Description
int

If found, returns the index of the control. Otherwise, returns -1.

Examples
IControlCollection controls = worksheet.Controls;
IButton button = controls.AddButton(20, 20, 100, 24);
int index = controls.IndexOf(button);