jntme
jntme

Reputation: 622

CTreeCtrl - only use checkboxes for certain rows/children

I have a CTreeCtrl and I filled it with content. Now I wanted to add checkboxes but JUST for certain ones. I've found the possibilty to activate checkboxes on the TreeCtrl with m_Tree.ModifyStyle(0, TVS_CHECKBOXES), but this adds a checkbox on each node/child on the whole Ctrl. Is it possible to turn this feature on, but just for certain ones?

All I found is the possibility to add three different pictures, catch the clickevent on a node and change the image. Is there an easier way? Let me know.

Thanks a lot, jntme

Upvotes: 1

Views: 1608

Answers (2)

saroj kumar
saroj kumar

Reputation: 330

I don't think that CTreeCtrl provide any method to add check boxes at specified node only. Easiest way to do this is explain in following link.

http://www.tech-archive.net/Archive/VC/microsoft.public.vc.mfc/2005-10/msg00454.html.

please go through and let me know if you are facing problem.

Upvotes: 1

rrirower
rrirower

Reputation: 4590

You may be able to accomplish what you want with a custom draw tree control. But, you'll need to render the image states yourself. That could get messy because you'll need to account for all of the possible different states.

Upvotes: 0

Related Questions