Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys,

Can someone please tell me what I have to do to create a tri-state treeview in VB.Net? I need it to change the check state of parent nodes (checked, mixed or unchecked) based on the checkstate of the child nodes, and also to check/uncheck all child nodes when the parent node is checked.

I know there are examples online but I am not very good at programming and they all are either in another language or confuse me. I have added a treeview control to a form, and I can get it to populate correctly (which i do programmatically) but I have no idea how to work the tri-state functionality.

Thank you!
Posted
Updated 22-May-12 20:58pm
v2
Comments
Sandeep Mewara 23-May-12 4:40am    
So, does that mean you need the 'exact' code to use it?
FFP@GC 23-May-12 13:19pm    
Hi,

Thank you for the response. I figured it out however by using the code listed here:

http://www.codeproject.com/Articles/6880/TriStateTreeview-in-VB-NET

It appears you cannot just add a tristate treeview graphically in visual studio and need to programmatically like so:

m_ctlTriStateTreeView = New TriStateTreeView(Me.StateImageList).

I dont fully understand what I've done but it is working.

Thanks again for your time.

OP has found a solution and resolved the question. This is just to pop this out of unanswered question.
 
Share this answer
 
This article worked for me

TriStateTreeview in VB.NET[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900