Okay, I know it's not very difficult to add check boxes to a treeview control. How can I make mixed-mode checkboxes? For example, Checked/Unchecked/Partially Checked (usually with a gray background)... so if I have a parent node with 5 children and one child is checked, then the parent would be mixed... on the other hand, if all children were checked, then the parent would have a normal "white" background or whatever the default color is...

I've searched up and down for examples on this and haven't found any.

Thanks,
_Shawn
Posted on 2002-02-22 04:34:25 by _Shawn
you said, that
Okay, I know it's not very difficult to add check boxes to a treeview control.
if you have this, just add the BS_AUTO3STATE style to the checkboxes.

Unfortunately I havent got an example too.
Posted on 2002-02-22 06:16:08 by beaster
I don't even know how to add checkboxes to the TreeView, I've yet to see an example yet almost all treeview controls on the VCL and ActiveX side support it... but none of my win32 programming books or references make any hints at how...



Thanks,
_Shawn
Posted on 2002-02-22 14:47:05 by _Shawn
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/CommCtls/TreeView/Styles.asp

Look at the style on the top of that page (TVS_CHECKBOXES). Basically it generates a few state images (checked, unchecked, greyed) for the treeview. The current state (and thus the state image) can be set in the TV_ITEM struct.

In the attachment you can find an example of how to add and set checkboxes in a listview, it basically works the same.

Thomas
Posted on 2002-02-22 15:22:36 by Thomas