开发者

Adding the check boxes in the TREEVIEW in c#

开发者 https://www.devze.com 2023-03-07 13:12 出处:网络
i w开发者_Python百科ant to add the check box to the child node of a certain parent node in the tree view in my application...How should i add it?TreeView has a property with the name CheckBoxes, if se

i w开发者_Python百科ant to add the check box to the child node of a certain parent node in the tree view in my application...How should i add it?


TreeView has a property with the name CheckBoxes, if set to true, it shows checkboxes for all child nodes.


The TreeView API only allows you to add/remove checkboxes for EVERY node. If that's what you want, then the answer is easy - use the TreeView's CheckBoxes property.

If you want a checkbox for a particular node in the tree only, then it gets tricky. .NET doesn't directly support that. You can get the tree to accept it using Win32 message overrides, see the link below for a solution elsewhere:

http://dotnetfollower.com/wordpress/2011/05/winforms-treeview-hide-checkbox-of-treenode/


You can't show checkboxes only for some TreeNodes - only for all of them or none at all. To enable the checkboxes for your tree set the CheckBoxes property to true.

0

精彩评论

暂无评论...
验证码 换一张
取 消