ImageList.ImageCollection.IndexOfKey(String) 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
确定集合中具有指定键的首个图像的索引。
public:
int IndexOfKey(System::String ^ key);
C#
public int IndexOfKey (string key);
member this.IndexOfKey : string -> int
Public Function IndexOfKey (key As String) As Integer
- key
- String
要检索其索引的图像的键。
如果在集合中找到具有指定键的首个图像,则其索引为从零开始;否则为 -1。
如果 IndexOfKey 连续调用,将首先检查最后返回的索引是否与键匹配,如果没有匹配项,搜索将从集合的开头开始。
图像的名称对应于图像中的 ImageList.ImageCollection键。 关键比较不区分大小写。 key
如果参数为null
空字符串,则IndexOfKey该方法返回 -1。
产品 | 版本 |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |
Windows Desktop | 3.0, 3.1, 5, 6, 7 |