Groups | Blog | Home
all groups > vb.net controls > september 2005 >

vb.net controls : TreeView_Help


sonali_reddy123 NO[at]SPAM yahoo.com
9/16/2005 7:10:29 AM
Hi,

I need a help regarding the checkbox property for a treeview.
Is there any way to change the color (appearance) of the treenode
which will indicate that the treenode is half way selected.
I mean I want to change the checkbox apperance only if few
subitems under a node are selected that means a the checkbox for
the entire node should nor be checked as some of its subitems are
not selected.

Can we have some property which will change the appearance of the
checkbox to some other color so that I can indicate the node to be
half selected.

Thanks in advance.
VR
11/4/2005 4:26:44 PM
You can try inheritance, that means:

1. you create a class that inherits checkbox and implement your behavior,
let's say a "State" property that will paint the checkbox as you wish
(overriding the paint method).

2. you find how to intercept the creation of a treeNode in the treeView
control and change it's checkBox to yours.

3. check the state of the sub-checked items and set the "State" property for
the checkbox you are assigning to the treeNode

Hope this can help,
Regards,
Victor Reboucas


[quoted text, click to view]

AddThis Social Bookmark Button