CTreeVtrl

Hi,

i have quite long text for each item which is to be added to the CTreeCtrl.
say there are 8 lines in a file, and 4 lines is one item. so now i use:

//"line" is one line
for (i=0i<=3;i++){
strcpy(item,line);
strcat(item,"\n");
}

but i always get the 4 lines be displayed in one line in the CTreeCtrl. and there are some strange characters in between.

could anyone pls help??

thanks a lot!
greenbirdAsked:
Who is Participating?
 
anoopsConnect With a Mentor Commented:
For not showing an image use the "mask"
member of TVITEM structure when you use the InsertItem() method of CTreeCtl.( Or the SetItem() method too )..

While inserting the item, if you don't want to have an associated image then remove TVIF_IMAGE and TVIF_SELECTEDIMAGE flags from the 'mask' member of TVITEM structure.

Hope this helps
0
 
Vinayak KumbarSr Program ManagerCommented:
Hi,

I don't think U can have more than one line for one item. U can make each line as an item.

Try with ownerdrawn tree control and such things.
VinExpert
0
 
greenbirdAuthor Commented:
Hi,

how to not set image for an item ? coz for the other 3 lines, i think can display without the image, then it is ok.

thanks a lot!
0
 
greenbirdAuthor Commented:
Hi,

sorry for delay in replying :)

but when i use InsertItem(), i did not use TVITEM, i use:

hException = m_treeCtrl.InsertItem(TVIF_TEXT,t1, 0, 0, 0, 0, 0, hGeneral, NULL);

so in this case, how to not show the image for it?

Thanks a  lot!
0
 
greenbirdAuthor Commented:
0
All Courses

From novice to tech pro — start learning today.