Yes you can. Inherit your class from the treecontrol and add a new property
for Selections. Maintain an arraylist in your class for selected nodes. then
every time the user clicks on a node, depending on the Ctrl or Shift button
status, add the nodes into the arraylist. Expose this arraylist as
Selections from your tree control.
As far as the drawing of selected items is concerned, you will need to
override OnBeforeSelect and OnAfterSelect and do your painting work
The "windows" way with a treeview is to use checkboxes. The control has a
"CheckBoxes" property. This gives great flexiblity without having to paint
the items yourself. You capture the BeforeCheck and AfterCheck events to
deal with the user's input (ie if you check a node that has child nodes do
you want to check all the child nodes??)
To determine the state after the fact you iterate thru the node and check
the "Checked" property.
Lloyd Sheen
s
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.