Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > treeview with custom checkbox
 

treeview with custom checkbox

Hello, i made an on implemenation of the checkbox with more states. now i want to use that control in the treeview instead of the normal checkbox; can someone help me a bit how to do that?
Dave Smits  Monday, August 24, 2009 2:05 PM
Hello Dave,

Thanks for your post on MSDN forum.

Based on my understanding, if the CheckBoxes property is set to true, TreeView control will show a "CheckBox" in front of each TreeNode to let user check or uncheck the node, however, the "CheckBox" in front of each TreeNode is not a real CheckBox control, it is painted like a CheckBox. If you just want to show more states for TreeNode, I suggest that you customize the appearance of the TreeView control by setting the DrawMode property and handling the DrawNode event.

Check the following for a sample.
http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.drawnode.aspx

If you want to embed the control in a TreeNode, I suggest that you place the control on the TreeNode when that node is selected, here is a sample for your reference.

http://www.codeproject.com/KB/tree/DropDownTreeView.aspx

Thanks,
Rong-Chun Zhang
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Rong-Chun Zhang  Tuesday, August 25, 2009 7:02 AM

Hello,

I am writing to check the status of the issue on your side. Would you mind letting me know the result of the suggestions? If you have any additional question, welcome to post here.

Have a great day!

Thanks,
Rong-Chun Zhang


Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
Rong-Chun Zhang  Monday, August 31, 2009 7:49 AM

You can use google to search for other answers

Custom Search

More Threads

• DataGridViewComboboxCell does not work.
• Datagridview + anonymous method
• Controling forms datasorse through vb
• Changing cell value in DGV does not update value in DataSet Table
• Binding combobox at runtime
• Combobox events
• DataGridView deleting while editing.
• Problem Iterating thru DataGridViewRows
• DatagirdComboBoxColumn+binding source problem
• datagridview row errors