Hi all,
I created a treeview that's only allowed user check on only one node at all parent. Below is my code.
VB Code:
Dim CheckOnlyOne As Node 'checked k = 0 Set CheckOnlyOne = Node.FirstSibling j = 0 If CheckOnlyOne.Checked = True Then Do Until CheckOnlyOne Is Nothing If CheckOnlyOne.Parent Is Nothing Then If CheckOnlyOne.Checked = True Then j = j + 1 End If End If If j > 1 Then MsgBox "Can select one department only", vbCritical, "Error to select department" Node.Checked = False Exit Sub End If Set CheckOnlyOne = CheckOnlyOne.Next Loop End If
The problem is when running debug with breakpoint the node is successfully to unchecked.However, when debugging end the node was checked back.
How to solve my problem ?
Thanks in Advance.




Reply With Quote