CtreeCtrl + selective checkboxes - Programmer
This is a discussion on CtreeCtrl + selective checkboxes - Programmer ; Hi All,
When I create a CTreeCtrl with TVS_CHECKBOXES option all the levels of
the tree appear with check boxes.
Is there a way to control the appearence of checkboxes.
eg all children of root have the check boxes and ...
-
CtreeCtrl + selective checkboxes
Hi All,
When I create a CTreeCtrl with TVS_CHECKBOXES option all the levels of
the tree appear with check boxes.
Is there a way to control the appearence of checkboxes.
eg all children of root have the check boxes and the grand children do
not.
Modifystyle() changes the behaviour of the whole tree but I want to do
this selectively.
Thankx in Advance.
Sunil.
-
Re: CtreeCtrl + selective checkboxes
sunny wrote:
> Hi All,
> When I create a CTreeCtrl with TVS_CHECKBOXES option all the levels of
> the tree appear with check boxes.
>
> Is there a way to control the appearence of checkboxes.
> eg all children of root have the check boxes and the grand children do
> not.
> Modifystyle() changes the behaviour of the whole tree but I want to do
> this selectively.
> Thankx in Advance.
> Sunil.
The tree control uses image state mask to show/hide the checkboxes (so
you can make your own). To turn off a checkbox for an item use:
TreeCtrl.SetItemState( HTREEITEM, 0, TVIS_STATEIMAGEMASK );
To turn it back on, I think its:
TreeCtrl.SetItemState( HTREEITEM, 0, TVIS_STATEIMAGEMASK );
Have fun,
A