禁用并灰显treenode的复选框 [英] Disable and grey out a check box of treenode

查看:159
本文介绍了禁用并灰显treenode的复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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)

提前感谢,

推荐答案

您可以将节点的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.

这篇关于禁用并灰显treenode的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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