Problem with treeview check node event

I

Ingman

Hi all,

Im using a treeview with checkboxes. When the user checks a node, if this
node had children, theese should be checked aswll. Im using the following
code under the nodecheck event:

Dim pNode As Node
Dim cNode As Node
Set pNode = Node

If pNode.Children > 0 Then
Set cNode = pNode.Child
Do
cNode.Checked = pNode.Checked
If cNode = cNode.LastSibling Then
Exit Do
Else
Set cNode = cNode.Next
End If
Loop
End If
Set pNode = Nothing
Set cNode = Nothing

And at first it looks just fine, however if the user checks/unchecks the
parent nodes really quickly, sometimes the children does not get checked. Its
hard to replicate but before i go any further with this case I just wanted to
check with you guys if you know anything about this behaviour?

Any ideas would be greatly appreciated :)

Best Regards,

Ingman
 

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.

Ask a Question

Top