In my C# Windows Form Application, I have Treeview control with checkboxes.
I want to hide check box of the certain tree node in TreeView control from user.How i do it?.
Please Guide me to get out of this issue…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This article explains on how you can hide the checbox of a certain node in a treeview.
Update
Explanation and code from the article:
Currently, there is not build-in support to get this done. But we can send
a TVM_SETITEM message to the treeview control, set TVITEM structure’s state
field to 0, and TVITEM’s hItem field to the treenode’s handle. Then this
treenode will be got rid of the checkbox.
Sample code lists below:
This code hides the selected treenode’s checkbox and it works well on my
side. You may copy and paste in your project to have a test.