首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

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

2012-01-14 
MSComctlLib.Node 类型不匹配VB codePrivate Sub GetChildName(ByVal Node As MSComctlLib.Node)If Not No

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)

就可以了。

热点排行