三状态树视图 Windows 窗体

发布于 2024-09-06 00:21:02 字数 290 浏览 4 评论 0原文

标准 TreeView 的缺点之一是您无法显示部分选择来指示某些子项已被选中。即使树没有完全展开,复杂树中的部分选择也允许用户轻松确定选择的位置。类似的想法也用在手动备份程序中,允许用户选择要备份的文件。

有谁知道如何使树视图复选框中的检查变为灰色?当检查某些(但不是全部)子节点时,我想将父节点的检查灰化。有点像您在软件安装过程中选择要安装的选项时看到的内容。

我看过几个帖子,但比较旧(2000年、2007年)。

现在,2010 年,我需要更好的答案。我用的是VS 2008。 .Net 3.5,Windows窗体

One of the frustrations with the standard TreeView is that you can't show a partial selection to indicate that some of the children are selected. A partial selection in a complex tree allows the user to easily determine where the selections are, even if the tree is not completely expanded. A similar idea is used in manu backup programs to allow the user to select the files to be backed up.

Does anyone know of a way to make the checks in a treeview checkbox gray? I want to gray the check of a parent node when some (but not all) of its child nodes are checked. Kinda like what you see when you are selecting options to install during a software installation.

I have seen several post, but is older (2000, 2007 year).

I now, in 2010, the better answer possible is required. I use VS 2008 . Net 3.5 , Windows Forms

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梨涡 2024-09-13 00:21:03

我正在使用这个 Tri-State TreeView,也来自 CodeProject。工作得很好 - 如果您需要一个更新的项目。

I am using this Tri-State TreeView, also from CodeProject. Works just fine - should you need a project more up to date.

玩心态 2024-09-13 00:21:03

代码项目上有一篇很好的文章就是关于这一点的。 三态 TreeView 控件

There's a nice article on code project about just this. Tri-State TreeView Control

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文