我已成功用TreeView列出某一目錄下的所有目錄及文件
但我應該怎樣給它們加上應有的Window圖標?
是目錄的給加上Windows目錄的圖標
是文件的給加上Windows上相應的文件圖標

解决方案 »

  1.   

    http://www.mvps.org/vbnet/index.html?code/toc/tocbytopic_f.htm
    Retrieving an Associated 16x16 Icon Using SHGetFileInfo
      

  2.   

    加入相应的图标,要使用SHGetFileInfo API。____________________________________________
    .:RNPA:.Royal Networks Programmers' Alliance
      

  3.   

    http://expert.csdn.net/Expert/TopicView1.asp?id=2072349____________________________________________
    .:RNPA:.Royal Networks Programmers' Alliance
      

  4.   

    这还不光是 SHGetFileInfo 一个函数就能解决的问题。
    还要把图标加进 treeview 呢。 :)
      

  5.   

    先绘制图标到 PictureBox ,然后将 PictureBox 中的图片褪底色后加入 ImageList,然后再在 TreeView中ListItems.Add
      

  6.   

    这有一个例子,shell编程,功能很全面,也很复杂:
    http://www.china-askpro.com/download/edeskvb.exe
      

  7.   

    另外一个范例:
    http://www.mvps.org/btmtz/vbexplorer/vbexplorer.zip