ListView.SelectedListViewItemCollection.ContainsKey(String) 方法

定义

确定集合中是否包含具有指定键的项。Determines whether an item with the specified key is contained in the collection.

public:
 virtual bool ContainsKey(System::String ^ key);
public virtual bool ContainsKey (string key);
abstract member ContainsKey : string -> bool
override this.ContainsKey : string -> bool
Public Overridable Function ContainsKey (key As String) As Boolean

参数

key
String

要在集合中查找的项的名称。The name of the item to find in the collection.

返回

Boolean

如果指定的项包含在集合中,则为 true;否则为 falsetrue to indicate the specified item is contained in the collection; otherwise, false.

注解

Name属性对应于中的的键 ListViewItem ListView.SelectedListViewItemCollectionThe Name property corresponds to the key for a ListViewItem in the ListView.SelectedListViewItemCollection.

密钥比较不区分大小写。The key comparison is not case-sensitive. 如果 key 参数为 null 或空字符串,则 ContainsKey 返回 falseIf the key parameter is null or an empty string, ContainsKey returns false.

适用于