windows - How to add image in CTreeCtrl list in MFC -
i trying add image before text in ctreelist control not coming up, observed the node name started after space , leaving space bitmap , image not showing up.. here code snap:-
cimagelist m_imagelist; cbitmap m_bitmap1; m_imagelist.create(16,16,ilc_color32,1,1); m_bitmap1.loadbitmap(idb_bitmap1); m_imagelist.add(&m_bitmap1, rgb(0,0,0)); treesoft->create(ws_child | ws_visible | ws_border | ws_tabstop | tvs_haslines | tvs_hasbuttons | tvs_linesatroot | tvs_singleexpand | tvs_showselalways | tvs_trackselect, crect(10, 10, 200, 240), this, 0x1221); treesoft->setimagelist(&m_imagelist, tvsil_normal); htree = treesoft->insertitem( l"software production",0,0, tvi_root); hcompany = treesoft->insertitem(l"microsoft",0,0, htree);
pls tell me missing here...
just testing purposes. create icon 16-bit color palette.
instead of ilc_color32 use ilc_color.
and instead of rgb(0,0,0) use (colorref)0xffffff
i have exact same code except smaller color palette , works.
if works can try bigger palette.
Comments
Post a Comment