+ -
当前位置:首页 → 问答吧 → MSComctlLib.Node 类型不匹配

MSComctlLib.Node 类型不匹配

时间:2011-09-22

来源:互联网

VB code

Private Sub GetChildName(ByVal Node As MSComctlLib.Node)
     If Not Node Is Nothing Then
         Dim lvItem As ListItem
         Set lvItem = lv.ListItems.Add(1, Node.Key, Node.Text)
         
         If Node.Children Then
             Call GetChildName(Node.Child)
         End If
         
     End If
 End Sub



VB code

Private Sub tv_NodeClick(ByVal Node As MSComctlLib.Node)
     If Node.Children > 0 Or Len(Node.Text) = 0 Then GoTo NEXTSTEP
     Dim strCmdResult As String
     strCmdResult = ExecuteCommand(strHeaderUrl & Node.FullPath)
     Dim strResultItemArray() As String
     strResultItemArray = Split(strCmdResult, vbCrLf)
     Dim Root As Node
     For Each ItemName In strResultItemArray
         If Len(ItemName) > 0 Then
             Set Root = tv.Nodes.Add(Node.Key, tvwChild, Node.Key & ItemName, Left(ItemName, Len(ItemName) - 1))
         End If
     Next
 NEXTSTEP:
     lv.ListItems.Clear
     GetChildName (Node)'这个地方提示类型不匹配
     
    Node.Expanded = True
 End Sub

作者: ronaltn   发布时间: 2011-09-22

GetChildName (Node)改成GetChildName Node 或者 call GetChildName(Node)

就可以了。

作者: chinaboyzyq   发布时间: 2011-09-22

热门下载

更多