Windows Develop Bookmark and Share   
 index > Windows Forms Designer > TreeNodes with checkboxes
 

TreeNodes with checkboxes

Hi all, 

does anyone know how to create a treeview where some nodes do have checkboxes and others don't? To me this seems like a fairly common problem, yet I haven't seen any reference to this so far - maybe I'm missing something obvious?
I know I can draw all the nodes myself by catching the appropriate messages (like some custom treeview implementations in this forum do), but quite frankly that seems to me like overkill. The stock TreeView implementation is rather lame.

Thanks,
Fafa
MigrationUser 1  Friday, June 13, 2003 11:52 AM
Yeah, unfortunately, checkboxes in the treeview are an "all or nothing" proposition.
MigrationUser 1  Friday, June 13, 2003 11:58 AM
Common controls v4.70 used to let you apply different "state images" to each item, to determine the checkbox appearance and also hide the checkbox for any item. Things might have changed in v5.80, though (see TVS_CHECKBOXES documentation for details). The "state image" feature is still there, though. So maybe you can use this instead of TVS_CHECKBOXES style to get finer control over per-item checkboxes. However, this is all 'raw' Win32 stuff, not part of the current WinForms tree view class.
MigrationUser 1  Tuesday, July 08, 2003 6:24 PM
Thanks,
I was just trying to avoid the Win32 API , I know it can be done this way and was wondering if  a pure Forms implementation was possible.
- Fabian
MigrationUser 1  Tuesday, July 08, 2003 6:36 PM
This is something we're looking at for a future release--not currently possible (in 1.1) without resorting to the win32 API.
MigrationUser 1  Friday, July 11, 2003 5:47 PM

You can use google to search for other answers

Custom Search

More Threads

• UserControl Designer mode failure?
• Is it Possible Make Form Controls Size Relative to User's Screen Size?
• question on opening a popup form from mainform.
• Custom Tree control -images not getting rendered on some machines
• Urgent for Tabindex in UserControl
• Ressources embedded problem with a compilation on the fly
• Details regarding UndoEngine Class in .NET
• Get BaseLine for InnerTextBox in a user control
• Design time behavior - what do you prefer?
• ListBox control in C#