Adding the necessary icon from CImageList in CTreeCtrl

Hello, I'm a beginner, do not judge strictly, there is a tree and there are icons, laden them in such a method

CImageList m_img;
m_img.Create( 16, 16, ILC_COLOR8, 0, 0);
m_img.Add(AfxGetApp()->LoadIcon(IDI_ICON1));
m_img.Add(AfxGetApp()->LoadIcon(IDI_ICON2));

Next, install yourself a list of icons in the tree (m_tree) m_tree.SetImageList(&m_img, 0);

This method contains a certain itemu (in this case tree_mb) icon whose number corresponds to the number from the list m_img
m_tree.SetItemImage(tree_mb,0,0);

And the actual problem is this, when you install SetImageList he puts into all sites of the first icon, and the place where I clearly stated that is m_tree.SetItemImage (tree_mb, 0,0); inserts, the one that was necessary, and it turns out that the same everywhere except that it is necessary. How to do so would have been superfluous those icons that I clearly pointed out by m_tree.SetItemImage (tree_mb, 0,0);. Thanks in advance!
Topic archived. No new replies allowed.