This comment relates to the recent thread in the Addition Libraries section, where Derez assures me his TreeViewPlus didn't mess with the event handling of the TreeView. So I'm repeating the info here....
We are talking of a TreeView with checkboxes.
Basically, if the first click on the contol is a check box, it doesn't matter which one, but as well as the check box being ticked, the Root node gets selected and a AfterSelect event occurs during the AfterEvent event, regardless of which node's check box you actually clicked on. This doesn't happen on a plain node selection being your first click. It doesn't happen on any subsequent click.
Another minor query, if I refer to the Root node by node2.Value = tv.GetNode(0), why is node2.IndexOfNode -1? It should surely be the same as the parameter to GetNode, afterall, it is the same node we are talking about.
I was playing with Derez's sample proggy to see how things hung together, so I'll attach the very slightly modified version I was using that found this problem.
Put a break on line 37. Run the prog. Click on any child text box (and nothing else. single step through the evemts to see what I mean. Then continue to Run to see the Root node selection on the control and the text in my little message box.
Continue without the breakpoint and try both the Root check box and the child check box you previously used and note the message box text understand the second comment.
Ta chaps.
We are talking of a TreeView with checkboxes.
Basically, if the first click on the contol is a check box, it doesn't matter which one, but as well as the check box being ticked, the Root node gets selected and a AfterSelect event occurs during the AfterEvent event, regardless of which node's check box you actually clicked on. This doesn't happen on a plain node selection being your first click. It doesn't happen on any subsequent click.
Another minor query, if I refer to the Root node by node2.Value = tv.GetNode(0), why is node2.IndexOfNode -1? It should surely be the same as the parameter to GetNode, afterall, it is the same node we are talking about.
I was playing with Derez's sample proggy to see how things hung together, so I'll attach the very slightly modified version I was using that found this problem.
Put a break on line 37. Run the prog. Click on any child text box (and nothing else. single step through the evemts to see what I mean. Then continue to Run to see the Root node selection on the control and the text in my little message box.
Continue without the breakpoint and try both the Root check box and the child check box you previously used and note the message box text understand the second comment.
Ta chaps.
Attachments
Last edited: