Link to home
Start Free TrialLog in
Avatar of Miss leah
Miss leahFlag for Israel

asked on

populate listview in vb.net: "Cannot add or insert the item more than one place" error

Hi experts, need some help please

I am migrating a desktop app from vb6 to vb.net using vs2015.
when populating a listview I get the error "Cannot add or insert the item more than one place. You must first remove it from its current location or clon vs2015"
the vb6 code is:
Set myNode = TreeView1.Nodes("a" & CStr(x))
Set myNode.Parent = TreeView1.Nodes("a" & CStr(y))
since in vb.net I cannt set parent - the vb.net code:
myNode = TreeView1.Nodes.Item("a" & CStr(x)
 TreeView1.Nodes.Item("a" & CStr(y)).Nodes.Add(myNode)
ASKER CERTIFIED SOLUTION
Avatar of Ark
Ark
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Miss leah

ASKER

Thanks:) helped alot