System.Windows.Forms.ListView.SelectedListViewItemCollection.IndexOfKey C# (CSharp) Method

IndexOfKey() public method

public IndexOfKey ( string key ) : int
key string
return int
			public virtual int IndexOfKey (string key)
			{
				if (!owner.is_selection_available || key == null || key.Length == 0)
					return -1;

				for (int i = 0; i < Count; i++) {
					ListViewItem item = this [i];
					if (String.Compare (item.Name, key, true) == 0)
						return i;
				}

				return -1;
			}
			#endregion	// Public Methods