When the MICROERP was developed, the permissions were initially allocated very simply. Later, after listening to other people's suggestions, the permissions were modified to control the document level, and did not control to the ammonium button.
Started using this tree control, it is really convenient to use, such as Cascade Select All, now gives the function
' Private Sub Checkchild (ByVal node as Mscomctllib.node, ByVal bcheck As Boolean, Optional ByVal bNext As Boolean = True, O Ptional ByVal bchild as Boolean = True)
' If not node was nothing Then
' Node. Checked = bcheck
‘
' If node. Children and Bchild Then ' Select the appropriate sub-node
' Call Checkchild (node. Child, Bcheck, True, True)
' End If
‘
' If BNext Then
' Call Checkchild (node. Next, bcheck, True, Bchild)
' End If
‘
' Parent node '
‘
' If not node. Parent is nothing and then
' If node. Parent.index <> 1 Then
' Node. parent.checked = True
' End If
' End If
' End If
' End Sub
‘
‘
' Private Sub Tvtype_nodecheck (ByVal node as Mscomctllib.node)
' Call Checkchild (node, node. Checked, False, True) call
' End Sub
The storage node data is used for each node, the stored data is correct, but the data is then displayed to the TreeView problem, the child nodes are not selected as expected.
Check, incredibly is VB itself bug, Microsoft gives the way is called API.
Technology: Try not to manipulate data with the TreeView