TreeNode.ShowCheckBox [英] TreeNode.ShowCheckBox
本文介绍了TreeNode.ShowCheckBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用VS 2005并且想知道为什么我没有这种方法?
I am using VS 2005 and just wonder why I don''t have this method?
推荐答案
因为它不存在?
有一个TreeView.CheckBoxes属性(bool),如果有帮助吗?
Marc
Because it doesn''t exist?
There is a TreeView.CheckBoxes property (bool) if that helps any?
Marc
我的情况是我已经设置了TreeView.CheckBoxes属性。
但是在这个树视图中我不想显示所有项目都有复选框,但
其中一些我只想显示文字和图标或文字。
例如:
Office as folder
在此办公室下文件夹,有些项目有复选框。
所以我想为这个Office设置TreeNode.ShowCheckBox = false。文件夹。
" Marc Gravell" < ma ********** @ gmail.comwrote in message
news:11 ******************** **@74g2000cwt.googlegro ups.com ...
Hi,
My situation is I already set the TreeView.CheckBoxes property.
But in this treeview I don''t want to show all items have checkboxes, but
some of them I want to show text and icon or text only.
For example:
Office as folder
Under this "Office" folder, there are items have checkboxes.
So I want to set the TreeNode.ShowCheckBox = false for this "Office" folder.
"Marc Gravell" <ma**********@gmail.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
因为它不存在?
有一个TreeView.CheckBoxes属性(bool),如果有帮助吗?
Marc
Because it doesn''t exist?
There is a TreeView.CheckBoxes property (bool) if that helps any?
Marc
我能建议的最好就是让这个复选框变得惰性;你可以通过处理TreeView的BeforeCheck事件和(对于
文件夹)设置" e.Cancel = true;" (其中e是event-args参数)
- 现在无法检查。
或者,您正在查看自定义图标,所以假装它...
可能效果不好。
Marc
The best I can suggest is to just make this checkbox inert; you can do
this by handling the TreeView''s BeforeCheck event, and (for the
folders) set "e.Cancel = true;" (where "e" is the event-args parameter)
- now it cannot be checked.
Alternatively, you''re looking at custom icons, so faking it... which
may not work so well.
Marc
>
这篇关于TreeNode.ShowCheckBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文