Naamala

Hi,

I am using Treeview control in C# windows application. In that each node contains Check Box and Image (it represents view as windows explorer with addition of checkboxes).

Now problem is if I select only few nodes the parent node of the selected nodes should be diplayed with the State of Checkbox as checked and that checkbox in in gray color. How Can I make checkboxes in gray color

Or Is there any possiblity to have CheckState like CheckBox having Three State for TreeView control CheckBoxes

thank

naamala



Re: .NET Compact Framework Make Checkbox Gray in TreeView

ChunSheng Tang - MSFT


Hi, naamala

It is possible to make a three state tree view although the standard TreeView does not support it directly.

One approach is to assign a ImageList the TreeView,and change the image index according to the state of the tree node. Here is a sample:
TreeView with Three-State Checkboxes

Another approach is to change the state image index of a tree node. Take a look at this thread:
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1997168&SiteID=1

Best Regards
Chunsheng Tang





Re: .NET Compact Framework Make Checkbox Gray in TreeView

Naamala

Hi Chunsheng Tang

Thank you for the very early. With the above article help I did the work.

thanks

naamala





Re: .NET Compact Framework Make Checkbox Gray in TreeView

CommonGenius.com

The state image index doesn't work, because only indexes of 0 and 1 are used; the tree view is hardcoded to use two and only two states, and there is no way to use StateImageList and StateImageIndex to get around that (which IMHO is an arbitrary and unnecessary limitation which should never have been introduced). The other article you linked to is in Visual Basic, not .NET. Has anyone actually found a decent, usable three-state tree view