title: TreeView1_NodeCheck compile error : procedure declaration does not match description of event or procedure having the same name
body: <p>I am trying to check/uncheck the children and subchildren if the parent node is checked. Also, the parent node gets checked if one of the children / subchildren is checked.</p>
  <p>My code works in my computer.</p>
  <p>In another PC it shows</p>
  <blockquote>
  <p>&quot;compile error : procedure declaration does not match description of event or procedure having the same name&quot;</p>
  </blockquote>
  <p>The error happens on the procedure declaration itself.</p>
  <p>Here is the code:</p>
  <pre class="lang-vb prettyprint-override"><code>Private Sub TreeView1_NodeCheck(ByVal Node As MSComctlLib.Node)
  
  Dim iChild, yChild As Integer
  Dim nodX, nodY As Node
  
      If Node.Children &lt;&gt; 0 Then
      'if there are children present, then Node is a parent
          Set nodX = Node.Child
          For iChild = 1 To Node.Children
              nodX.Checked = Node.Checked
              
              If nodX.Children &lt;&gt; 0 Then
              'if there are children present, then node is a child with subchildren
                  Set nodY = nodX.Child
                  For yChild = 1 To nodX.Children
                      nodY.Checked = nodX.Checked
                      Set nodY = nodY.Next
                      'if a subchild is checked, then nodX, which is a child, should be checked
                      'do this loop to check if any of the subchildren is checked, then check the child
                  Next
               End If
              'if a child is checked, then Node, which is a parent, should be checked
              'do this loop to check if any of the children is checked, then check the parent
              Set nodX = nodX.Next
          Next
      Else
          If Not Node.Parent Is Nothing Then
          'if the parent of the Node does exist, then it is a child
              If Node.Checked Then
                  'check the parent and skip the loop if the current node is checked.
                  Node.Parent.Checked = True
              Else
                  Node.Parent.Checked = False
                  'if the Node, which is a child, is unchecked, then uncheck the parent
                  'however, proceed with the loop below to see if other children are checked. If yes, check the parent
                  Set nodX = Node.Parent.Child
                  Do Until nodX Is Nothing
                      If nodX.Checked Then
                          'at least one other child node is checked so check the parent and exit the loop
                           Node.Parent.Checked = True
                           Exit Do
                       End If
                       Set nodX = nodX.Next
                  Loop
              End If
          End If
       End If
  End Sub
  </code></pre>
  <p>I picked the event from the dropdown boxes of VBA.</p>