'Should children be selected automatically when using TVS_CHECKBOXES (CTreeCtrl)

Yeah, still using MFC...

I have a CTreeCtrl with TVS_CHECKBOXES. When I click on a parent's checkbox, should the children's checkboxes automatically be checked/unchecked? Similarly, if I manually check all children's checkboxes, should the parent's checkbox automatically be checked?

I know that is the expected behavior of a tree control with checkboxes. My question is whether the tree control can do this automatically (which isn't happening in my app) or if I need to code this behavior. I didn't want to code this if it is built-in functionality.

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source