读书人

MSComctlLib.Node 类型不匹配解决方法

发布时间: 2012-01-14 20:02:35 作者: rapoo

MSComctlLib.Node 类型不匹配

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


[解决办法]
GetChildName (Node)改成GetChildName Node 或者 call GetChildName(Node)

就可以了。

读书人网 >VB

热点推荐