1

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

4

2 回答 2

1

我不认为 CTreeCtrl 提供任何方法来仅在指定节点添加复选框。最简单的方法是在下面的链接中解释。

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

如果您遇到问题,请通过并告诉我。

于 2013-09-19T02:27:38.390 回答
0

您可以使用自定义绘制树控件完成您想要的操作。但是,您需要自己渲染图像状态。这可能会变得一团糟,因为您需要考虑所有可能的不同状态。

于 2013-09-18T16:42:19.377 回答