Control.ControlCollection.IndexOfKey Method (String)
Retrieves the index of the first occurrence of the specified item within the collection.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The name of the control to search for.
Return ValueType: System.Int32
The zero-based index of the first occurrence of the control with the specified name in the collection.
Ifis called successively, the last returned index will be checked for a key match first, and if there is no match, the search starts at the beginning of the collection.
The key comparison is not case-sensitive. If the key parameter is null or an empty string, or an item with the specified key is not found,returns -1.
Available since 2.0