System.Windows.Forms.Control.ControlCollection.IndexOfKey C# (CSharp) Method

IndexOfKey() public method

public IndexOfKey ( string key ) : int
key string
return int
			public virtual int IndexOfKey (string key)
			{
				if (string.IsNullOrEmpty (key))
					return -1;
				
				for (int i = 0; i < list.Count; i++)
					if (((Control)list[i]).Name.Equals (key, StringComparison.CurrentCultureIgnoreCase))
						return i;
				
				return -1;
			}