System.Drawing.Image myImage = System.Drawing.Image.FromFile("test.jpg");System.WinForms.ImageList oImages = new System.WinForms.ImageList();
oImages.Add (myImage);

解决方案 »

  1.   

    to:karma(无为).出问题了.不好用.
      

  2.   

    I do not have exact code at hand, but if you have patience, you can look through the sample code from these two articles:
    1. use imagelist with TreeView 
    http://www.c-sharpcorner.com/winforms/Niranjan_winexplorer.asp
    2. ImageList Control Sample
    http://www.gotdotnet.com/quickstart/winforms/doc/ControlRef/ImageListCtl.aspx
      

  3.   

    用karma(无为)说的代码将图标加入ImageList,然后你还需要将ImageList与ListView的三中显示方式(List, Report, SmallIcon )关联起来:
    listView1.SmallImageList = imageList1;