如图,在设计窗口装载的图片显示不存在index,但资源文件里好像有呀。
this.imageList1.ImageSize = new System.Drawing.Size(60, 80);这句调整到
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
这句上面,重置ImageSize会重新创建图像列表,所以原先设置的Images被清空变为长度为0的数组
有帮助麻烦点个采纳【本回答右上角】,谢谢~~
遍历打印一下imagelist1,看看里面有没有图片。
在错误行之前,确认一下this.imageList1.count是否大于0