From: wei.niu on
// clear cut state
TreeView_SetItemState( hwnd, hItemCut, 0, TVIS_CUT ) ;

// set cut state
TreeView_SetItemState( hwnd, hItemCut, TVIS_CUT,TVIS_CUT ) ;

When I cutted the item,its icon changed to dark.I hope it changes to a
little vague,just like windows explorer.I can change item's icon by
myself without setting TVIS_CUT state,but does it mean TVIS_CUT is
useless if I do that?

Also I tried to use overlay image to get the effect but failed.
From: Tom Serface on
I haven't had much luck with that one either. You could try to use custom
draw to change your fonts on selected items:

http://msdn2.microsoft.com/en-us/library/bb775487(VS.85).aspx

Here is an article using a list view and you could adapt this information to
the tree view:

http://www.codeproject.com/KB/combobox/lvcustomdraw.aspx

Tom

<wei.niu(a)gmail.com> wrote in message
news:1f287960-2f36-4a4e-a96d-aa450a699fc7(a)34g2000hsf.googlegroups.com...
> // clear cut state
> TreeView_SetItemState( hwnd, hItemCut, 0, TVIS_CUT ) ;
>
> // set cut state
> TreeView_SetItemState( hwnd, hItemCut, TVIS_CUT,TVIS_CUT ) ;
>
> When I cutted the item,its icon changed to dark.I hope it changes to a
> little vague,just like windows explorer.I can change item's icon by
> myself without setting TVIS_CUT state,but does it mean TVIS_CUT is
> useless if I do that?
>
> Also I tried to use overlay image to get the effect but failed.

From: wei.niu on
On 4$B7n(B23$BF|(B, $B2<8a(B8$B;~(B34$BJ,(B, "Tom Serface" <tom.nos...(a)camaswood.com> wrote:
> I haven't had much luck with that one either. You could try to use custom
> draw to change your fonts on selected items:
>
> http://msdn2.microsoft.com/en-us/library/bb775487(VS.85).aspx
>
> Here is an article using a list view and you could adapt this information to
> the tree view:
>
> http://www.codeproject.com/KB/combobox/lvcustomdraw.aspx
>
> Tom

Thank you,Tom.

As my trouble is the treeview item's icon changed to a black square
after I cutted it,I don't need redraw the item,I just need to set the
item's icon through TreeView_SetItem.My question is: it looks like the
function of setting item's state to TVIS_CUT is only changing the
item's icon,so can I control how the icon would be changed?At least,I
don't want it changed to be a black square.
From: Tom Serface on
I've never been able to get TVIS_CUT to work that's why I was suggesting a
possible alternative. Could be that there is something in that style that
is or'ing the icon or something to try to dim it out and it just isn't
working correctly. You may be able to try to draw the disabled tree items
using something like in these articles:

http://www.codeguru.com/Cpp/controls/treeview/misc-advanced/article.php/c633
http://www.codeproject.com/KB/tree/colortreectrl.aspx

Tom

<wei.niu(a)gmail.com> wrote in message
news:abc871b8-7bd6-46da-b8e7-771d9f805289(a)z24g2000prf.googlegroups.com...
> On 4$B7n(B23$BF|(B, $B2<8a(B8$B;~(B34$BJ,(B, "Tom Serface" <tom.nos...(a)camaswood.com> wrote:
>> I haven't had much luck with that one either. You could try to use
>> custom
>> draw to change your fonts on selected items:
>>
>> http://msdn2.microsoft.com/en-us/library/bb775487(VS.85).aspx
>>
>> Here is an article using a list view and you could adapt this information
>> to
>> the tree view:
>>
>> http://www.codeproject.com/KB/combobox/lvcustomdraw.aspx
>>
>> Tom
>
> Thank you,Tom.
>
> As my trouble is the treeview item's icon changed to a black square
> after I cutted it,I don't need redraw the item,I just need to set the
> item's icon through TreeView_SetItem.My question is: it looks like the
> function of setting item's state to TVIS_CUT is only changing the
> item's icon,so can I control how the icon would be changed?At least,I
> don't want it changed to be a black square.

From: wei.niu on
On 4$B7n(B24$BF|(B, $B2<8a(B1$B;~(B36$BJ,(B, "Tom Serface" <tom.nos...(a)camaswood.com> wrote:
> I've never been able to get TVIS_CUT to work that's why I was suggesting a
> possible alternative. Could be that there is something in that style that
> is or'ing the icon or something to try to dim it out and it just isn't
> working correctly. You may be able to try to draw the disabled tree items
> using something like in these articles:
>
> http://www.codeguru.com/Cpp/controls/treeview/misc-advanced/article.p...http://www.codeproject.com/KB/tree/colortreectrl.aspx
>
> Tom

Thanks.

It looks like it's a bug of treeview.I will change the icon by myself.