Menu.MenuItemCollection.ContainsKey(String) 方法
定义
确定集合是否包含具有指定键的项。Determines whether the collection contains an item with the specified key.
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 look for.
返回
如果集合包含具有指定键的项,则为 true;否则为 false。true if the collection contains an item with the specified key, otherwise, false.
注解
Name属性对应于中的的键 MenuItem Menu.MenuItemCollection 。The Name property corresponds to the key for a MenuItem in the Menu.MenuItemCollection.
密钥比较不区分大小写。The key comparison is not case-sensitive. 如果 key 参数为 null 或空字符串,则 ContainsKey 返回 false.If the key parameter is null or an empty string, ContainsKey returns false.