Hi

In my VC++ 6 app I create a CTreeView with just the root element and
display the GUI to the user. When I later add some child elements to
the CTreeView (in response to an action in another part of the
application) I find that the elements are hidden (which is fine), but
no "+" sign appears by the root element to notify the user. If the
user clicks where the "+" sign would be, the "+" sign appears (along
with the child elements). What do I need to run when adding elements
to the view to ensure that any new "+" signs appear ?

Many thanks,
Neil.

Re: CTreeView update plus sign by David

David
Mon Jan 07 18:38:22 CST 2008

>In my VC++ 6 app I create a CTreeView with just the root element and
>display the GUI to the user. When I later add some child elements to
>the CTreeView (in response to an action in another part of the
>application) I find that the elements are hidden (which is fine), but
>no "+" sign appears by the root element to notify the user. If the
>user clicks where the "+" sign would be, the "+" sign appears (along
>with the child elements). What do I need to run when adding elements
>to the view to ensure that any new "+" signs appear ?

Neil,

When you add a node that has child elements, do you set the
TVIF_CHILDREN flag and set the cChildren member?

Dave

Re: CTreeView update plus sign by neilsolent

neilsolent
Tue Jan 08 02:36:50 CST 2008


> When you add a node that has child elements, do you set the
> TVIF_CHILDREN flag and set the cChildren member?
>

Thanks for the reply. I tried that, but still had the same issue.
I am now doing this, and it has solved it:

treeCtrl.Expand(parentItem, TVE_TOGGLE);
treeCtrl.Expand(parentItem, TVE_TOGGLE);

.. but I shouldn't really have to.