为什么不保存到ImageList.Images [i] .Tag? [英] Why not save to ImageList.Images[i].Tag?

查看:91
本文介绍了为什么不保存到ImageList.Images [i] .Tag?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ImageList1 = new ImageList();

//错误运行时间:InvalidArgument =值'0'对'index'无效。参数名称:index

ImageList1.Images [i] .Tag =" 10" ;; //运行此行时出错。
$
ImageList1.Images.Add(key,Image);
$


为什么不保存到标签中?

解决方案




我想从你所写的内容中你试图使用键"0"添加更多次图像。


请注意,标记不是索引,它只是可以添加到图像的额外数据。  






成功


林前


In ImageList1 = new ImageList ();
// Error running time: InvalidArgument = Value of '0' is not valid for 'index'. Parameter name: index
ImageList1.Images [i] .Tag = "10"; // error when running time this line.
ImageList1.Images.Add (key, Image);

Why not save into tag ?

解决方案


I guess from what you have written that you try to add more times an image with the key "0".

Be aware that a Tag is not an index, it is just an extra piece of data which you can add to an image. 

Success

Cor


这篇关于为什么不保存到ImageList.Images [i] .Tag?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆