I am trying to get the users confirmation when clicking a checkbox in the treeview control.
Code snippet:
In debug mode, I can see the checkbox clear when the line *** is executed, but at the end of the sub, the check box rechecks itself. Nothing I do inside the sub, as far as checking/unchecking is persistent, when the sub ends, it sets the value to whatever was going to be when the user clicked. Is there any way to cancel a checkbox click?Code:Sub treeGuideline_NodeCheck(ByVal Node As MSComctlLib.Node) If Node.Children > 0 Then 'Parent msgreturn = MsgBox("Checking this node will select all sections and guidelines below it. Do you wish to continue?", vbYesNo + vbQuestion) ' If msgreturn = vbNo Then ' Node.Checke= False '*** ' Else ' bDirty = True 'All the work done when checking/unchecking is done in the 'following 2 subs. CheckNodes frmTree.treeGuideline, Node, Node.Checked, True checkforsiblings frmTree.treeGuideline, Node, Node.Checked ' End If End if ' some other stuff End Sub




Reply With Quote