Board index » cppbuilder » Treview with checkboxes but not for all nodes

Treview with checkboxes but not for all nodes


2006-10-10 01:31:37 AM
cppbuilder30
Hi all
I'm looking for a way to have a treeview with checkboxes for some nodes
and not for other.
Basically, I would like to be able to choose to have checkboxes
individually for each nodes dépending on some attributes of the data
handle by the data property.
I think I will have to write a custom component for that.
Do you have some advice for writing this component ?
thank you
 
 

Re:Treview with checkboxes but not for all nodes

"E B" < XXXX@XXXXX.COM >wrote in message
Quote
I'm looking for a way to have a treeview with checkboxes
for some nodes and not for other.
You will have to use your own ImageList for that. You can then set the
StateIndex property on a per-node basis as needed.
Quote
I think I will have to write a custom component for that.
No, you do not. The standard TreeView will work just fine for it.
Gambit
 

Re:Treview with checkboxes but not for all nodes

thank you for your answer, I'll do that
 

{smallsort}

Re:Treview with checkboxes but not for all nodes

"E B" < XXXX@XXXXX.COM >
try this to make TTreeView checkboxAble
DWORD dwStyle = GetWindowLong(TreeView1->Handle, GWL_STYLE);
dwStyle = dwStyle | TVS_CHECKBOXES;
SetWindowLong(TreeView1->Handle, GWL_STYLE, dwStyle);
try this to set/unset checkboxes
bool a_Checked = true;
TTreeNode *a_Node = ....
TreeView_SetCheckState(TreeView1->Handle, a_Node->ItemId, a_Checked);
Dmitry Konnov
sourceforge.net/projects/rodbcrm/