Technology: Try not to manipulate data with the TreeView

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.