为什么这个简单的函数老是报错,帮我看一下,谢谢
Private Sub ToggleAllParentNodes(ByVal CurrentNode As MSComctlLib.Node, ByVal nodechecked As Boolean)
If nodechecked Then
CurrentNode.Checked = nodechecked
If CurrentNode.Parent Is Not Null Then
ToggleAllParentNodes CurrentNode.Parent, nodechecked
End If
End If
End Sub
[解决办法]
CurrentNode.Parent Is Not Null 这个条件总觉得有点别扭。currentNode.parent 应该是一个对象。建议用 if not cuurentNode.parent is nothing ......