CTreeCtrl三态复选框可能吗? [英] CTreeCtrl tri-state checkboxes possible?

查看:170
本文介绍了CTreeCtrl三态复选框可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CTreeCtrl有3种扩展样式:

TVS_EX_DIMMEDCHECKBOXES

TVS_EX_EXCLUSIONCHECKBOXES

TVS_EX_PARTIALCHECKBOXES

There are 3 extended styles for the CTreeCtrl:
TVS_EX_DIMMEDCHECKBOXES
TVS_EX_EXCLUSIONCHECKBOXES
TVS_EX_PARTIALCHECKBOXES

但没有关于这些风格实际做什么的充分文档。  对此的任何见解都将受到赞赏。

but no adequate documentation on what these styles actually do.  Any insight on this would be appreciated.

更具体地说,在我的带有复选框的树中,我希望父级能够反映其子级的聚合状态,并在其中一个时更新孩子被选中/取消选中。  即,如果未选中任何子项,则将取消选中父项。
 如果选中全部,则会检查父项。  如果选中了一个或多个子项,但未选中所有子项,则父复选框将具有三态以反映此情况。

More specifically, in my tree with checkboxes, I'd like the parent to reflect the aggregate state of its children, updated when one of the children are checked/unchecked.  That is, if none of the children are checked, the parent would be unchecked.  If all are checked, the parent would be checked.  If one or more children are checked but not all are checked, then the parent checkbox would have a tri-state to reflect this.

上述任何一种样式都可以允许吗?  如何设置父母,具有什么价值?  我在这里看不到任何可用的东西。  仅供参考,这是使用VS2010,C ++。

Can any of these styles above allow this?  And how can the parent be set, with what value?  I don't see anything available here.  FYI, this is using VS2010, C++.

http://msdn.microsoft.com/en-us/library/bb759985(v = vs.100).aspx

谢谢你的帮助!

大卫

Thanks for you help!
David

PS:Dobb博士显然已经解决过这个问题了很久以前时间膨胀的软件世界,实际上是在2002年。但是,这可能在这些扩展风格存在之前。

PS: Dr. Dobb's obviously addressed this issue eons ago (which in the time-dilated software world, actually was eons) back in 2002.  But that was likely before these extended styles existed.

http://www.drdobbs.com/multi-state-checkbox -tree-views / 184416437




推荐答案

您好,

您可以查看此页面:
Tree-View Control Extended St yles(Windows)

TVS_EX_DIMMEDCHECKBOXES:
Windows Vista
。如果控件具有 $ b,请包含暗淡的复选框状态$ b TVS_CHECKBOXES 风格。

TVS_EX_DIMMEDCHECKBOXES: Windows Vista. Include dimmed checkbox state if the control has the TVS_CHECKBOXES style.

TVS_EX_EXCLUSIONCHECKBOXES:Windows Vista。如果控件具有TVS_CHECKBOXES样式,则包括排除复选框状态。

TVS_EX_EXCLUSIONCHECKBOXES: Windows Vista. Include exclusion checkbox state if the control has the TVS_CHECKBOXES style.

TVS_EX_PARTIALCHECKBOXES:Windows Vista。如果控件具有TVS_CHECKBOXES样式,则包括部分复选框状态。

TVS_EX_PARTIALCHECKBOXES: Windows Vista. Include partial checkbox state if the control has the TVS_CHECKBOXES style.

谢谢,


这篇关于CTreeCtrl三态复选框可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆