以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  treeview的错误  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=148803)

--  作者:newsun2k
--  发布时间:2020/4/15 16:34:00
--  treeview的错误
代码:    Dim td As WinForm.TreeNode
    td = tvw1.nodes(Index)

下面这个错误。啥错误?

---------------------------
错误
---------------------------
编译错误:Overload resolution failed because no accessible \'Item\' can be called without a narrowing conversion:
    \'Public ReadOnly Default Property Item(Name As String) As WinForm.TreeNode\': Argument matching parameter \'Name\' narrows from \'Long\' to \'String\'.
    \'Public ReadOnly Default Property Item(Index As Integer) As WinForm.TreeNode\': Argument matching parameter \'Index\' narrows from \'Long\' to \'Integer\'.



错误代码:td = tvw1.nodes(Index)
---------------------------
确定   
---------------------------


--  作者:有点蓝
--  发布时间:2020/4/15 16:41:00
--  
错误提示意思是传入的参数类型不对,需要字符型string或者整数integer,但是传入了长整数long。
td = tvw1.nodes(cint(Index))