日期:2014-05-20  浏览次数:22964 次

帮助:指定的参数已超出有效值的范围
指定的参数已超出有效值的范围。参数名: “0”不是“index”的有效值。 
隐藏  

在 System.Windows.Forms.Design.ImageListDesigner.OriginalImageCollection.get_Item(Int32 index)
在 System.Windows.Forms.Design.ImageListDesigner.OriginalImageCollection.SetKeyName(Int32 index, String name)



代码:
this.imageList2.ImageStream = (ImageListStreamer) resources.GetObject("imageList2.ImageStream");
   
  this.imageList2.Images.SetKeyName(0, "货物.png");
  this.imageList2.Images.SetKeyName(1, "货车.png");
  this.imageList2.Images.SetKeyName(2, "Mac_Folder_32.png");
  this.imageList2.Images.SetKeyName(3, "Mac_Folder_12.png");
  this.imageList2.Images.SetKeyName(4, "Mac_Folder_41.png"); 

不知道什么原因


------解决方案--------------------
this.imageList2.Images.SetKeyName(0, "货物.png");
吧这个删了!

或者写this.imageList2.Images.SetKeyName(5, "货物.png");

------解决方案--------------------
http://social.msdn.microsoft.com/Forums/zh-CN/2212/thread/6099c8d0-3e12-408f-9cba-71a1d466959d/
------解决方案--------------------
跟踪调试下,,
------解决方案--------------------
应该是索引值的问题吧。。。。你那个0,1,2。。。。那些数字是从哪里来的?