请问 在 imageList 中如何设置和使用KEY值                
我的测试代码如下
                       
ResourceManager rm = new ResourceManager ( "资源文件制作.My" , Assembly.GetExecutingAssembly ( ) ) ;
string a2 ;
a2="a1";
Icon icoDemo = ( ( Icon ) rm.GetObject ( a2 ) ) ;
imageList2.Images.Add(icoDemo);
             this.button1.Image = imageList2.Images[1] ;
先是从资源文件中读取图标,然后将图标赋予到imagelist中,我的问题是,这时候如何设置KEY值,以及如何用KEY值读出imageList中的图标,谢谢,

解决方案 »

  1.   

    补充下:我的要求就是不用INDEX而用KEY操作,
      

  2.   

    imagelist不支持,你可以在ImageList上进行扩展处理,也就是你需要手动增加代码进行处理。
      

  3.   

    就是用ArrayList来存储Key,并保持其和ImageList的信息同步,那么检索的时候,先检索ArrayList,获得Index然后再用此Index去检索ImageList。