如何获取ImageList中图片的Name
遍历this.imageList1.Images.Keys即可。
//遍历代码
for (int i = 0; i < this.imageList1.Images.Keys.Count; i++)
{
MessageBox.Show(this.imageList1.Images.Keys[i].ToString());
}
string result = this.imageList1.Images.Keys.OfType<string>().FirstOrDefault(x => x == "accept.png");//accept.png为文件名