我用CTreeCtrl加载图标显示,在theCtrl.SetImageList(g_ImgList, TVSIL_NORMAL);时使用TVSIL_NORMAL就可以显示图片出来,换成TVSIL_STATE就不显示图片。请问这是什么情况啊?...
g_ImgList->Create(32, 32, ILC_COLOR32|ILC_MASK, 0, 1);
m_bitmapNotDown.LoadBitmap(IDB_BITMAP_NOTDOWN);
g_ImgList->Add(&m_bitmapNotDown, RGB(255, 255, 255));
theCtrl.SetImageList(g_ImgList, TVSIL_NORMAL);
m_hNotDown = theCtrl.InsertItem(strText, 0, 0);
...

解决方案 »

  1.   

    TVSIL_NORMAL   Sets the normal image list, which contains the selected and nonselected images for the tree view item.一个是图标TVSIL_STATE   Sets the state image list, which contains the images for tree view items that are in a user-defined state.一个是(自定义)状态
      

  2.   

    还是不懂,也就是说,如果用TVSIL_STATE,如何显示图片出来,能详细说一下吗?
      

  3.   

    到底要显示什么图?一般图标使用前者。
    TVSIL_STATE只在做树形的item的check_state用过。索引和对应的关系查看TVITEM
      

  4.   

    TVSIL_NORMAL 就是显示选中或者未选中item时的图标,这个应该很好理解,那么理解了这个,其实就不难理解TVSIL_STATE了,因为选中或者未选中,这个状态的出现,就就会导致在TVSIL_NORMAL下显示设置的图片,而一些人设置了TVSIL_STATE却不显示图片,是因为没有出现相应的状态。仔细看一下它的定义:
    TVSIL_STATE Sets the state image list, which contains the images for tree view items that are in a user-defined state.
    也就是为用户自定义状态来显示相应的图片,你看看你的程序里有没有出现自定义的状态?