CTreeCtrl item icon change

  • Thread starter Thread starter VickyCool4U
  • Start date Start date
V

VickyCool4U

Guest
Hi Experts,


I have created class inherit from CtreeCtrl name CMytreeCtrl in mfc visual studio 2010 professional edition

CMytreeCtrl obTreeCtrl;

I would like to display different icon , when expanding a particular node as follows:-


If item is not expanded

m_imageList.Create (16, 16, ILC_COLOR32, 1,1); where m_imageList,m_bitmap are class variable
m_bitmap.LoadBitmap(IDB_BITMAP5);

m_imageList.Add(&m_bitmap, RGB(255,0,255));

SetImageList (&m_imageList, TVSIL_NORMAL);

//if not child node

SetItemImage(hTreeItemRoot,0,0);//parent node

SetItemImage(hTreeItem,1,2) // child node


So if I expand the child node image index no 2 is used for selected image index otherwise image index no 1 is displayed

I am following the msdn :-

CTreeCtrl Class


Please correct me where I am wrong.

Continue reading...
 
Back
Top