IndexOf Method

Control.ControlCollection.IndexOf Method

Retrieves the index of the specified control in the control collection.

[Visual Basic]
Public Function IndexOf( _
   ByVal control As Control _
) As Integer
[C#]
public int IndexOf(
 Control control
);
[C++]
public: int IndexOf(
 Control* control
);
[JScript]
public function IndexOf(
   control : Control
) : int;

Parameters

control
The Control to locate in the collection.

Return Value

A zero-based index value that represents the position of the specified Control in the Control.ControlCollection.

Remarks

If the control is not found in the collection, the IndexOf method return value is -1.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

Control.ControlCollection Class | Control.ControlCollection Members | System.Windows.Forms Namespace

Show:
© 2016 Microsoft