Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# checkboxes in treeview

I use a treeview in my application (C#, gui). I want to hide checkboxes in 'Node 1' and in 'Node 1.1.1'. How can i do it? My treeview looks like that:

TreeView 1

   -Node 1

      - Node 1.1

              -Node 1.1.1

                   -Node 1.1.1.A

                   -Node 1.1.1.B

              -Node 1.1.2

                   -Node 1.1.2.A 

I use :

treeview1.checkboxes = true;

to show all checkboxes, but how can i hide someone?

like image 959
user449921 Avatar asked Jan 01 '26 01:01

user449921


1 Answers

Unfortunately no, not without subclassing TreeView and overriding some of the control painting.

This question's accepted answer has the information you need: How can I control checkboxes in a .Net Forms.TreeView?

like image 164
Adam Lear Avatar answered Jan 02 '26 15:01

Adam Lear



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!