I have a simple tree control, so i want to add some icons to my tree control nodes. DDX_Control(pDX, IDC_TREE1, m_TreeView);
m_TreeView.InsertItem(L"Skills");
HTREEITEM main = m_TreeView.InsertItem(L"Technical");
m_TreeView.InsertItem(L"C++", main);
m_TreeView.InsertItem(L"Java", main);
m_TreeView.InsertItem(L".Net", main);
m_TreeView.InsertItem(L"Python", main);
HTREEITEM main1 = m_TreeView.InsertItem(L"Non_Technical");
m_TreeView.InsertItem(L"Admin", main1);
m_TreeView.InsertItem(L"HR", main1);
The above lines are to create the Tree-Control, So i want to create the icons with my nodes..Can anyone tell me the code for adding icons to tree control. Thanks in advance...
First of all you need to create
CImageListobject instance.You can use either bitmap or icon as image source.
And the last step is to bind your image list with your tree: