禁用并灰显树节点的复选框

发布于 2024-11-16 10:19:59 字数 150 浏览 5 评论 0原文

我需要创建一个树视图,树中的某些节点将具有复选框,而其他节点将具有禁用复选框 - 看起来灰色为禁用。 一旦用户选中禁用复选框,复选框图像将更改为不同的图像(-选中但仍为灰色)。 除了复选框之外,此树视图还将有图标。 (我正在使用 winform 树视图控件)

提前致谢,

I need to create a treeview that some nodes in the tree will have checkbox and other nodes will have a disable checkbox - that looks gray as disable.
once the user check the disable check box the check box image will be changed to a different image (-checked but still grey).
this treeview will have also icon , besides the check box.
(I'm using the winform treeview control)

thanks in advance,

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

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

发布评论

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

评论(1

戴着白色围巾的女孩 2024-11-23 10:19:59

您可以将节点的 ShowCheckBox 属性设置为 False,并将 ImageUrl 设置为禁用复选框的图片。不过,听起来您可能将 ImageUrl 用于其他用途,因此您可能需要为这些节点创建图标,以便它们显示您的图标和禁用的复选框。

You can set the ShowCheckBox property of the node to False, and the ImageUrl to a picture of a disabled checkbox. It sounds like you might be using the ImageUrl for something else, though, so you might need to create your icons for these nodes so that they show your icon and also a disabled checkbox.

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