Control.ControlCollection.IndexOf Method (Control)

 

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

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public int IndexOf(
	Control control
)

Parameters

control
Type: System.Windows.Forms.Control

The Control to locate in the collection.

Return Value

Type: System.Int32

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

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

.NET Framework
Available since 1.1
Return to top
Show: