dynamic_sysop
Senior Contributor
Hi can someone please help me with a question on listview in visual basic.net, i have always used vb6 and to remove an item is easy in that for example.....
Dim sName as String, i as Integer
For i = 1 to listview.listitems.count
if listview.listitems(i).text = sName Then
listview.listitems.remove(i)
Exit For
End if
Next i
this would remove the item from the listview in vb6, but in .net i cant find anyway of removing an item short of if you have selected it:-\ , i make chat clients on msn-chat and use listview as the names list, therefore i cant just make it so an item is removed by clicking on it, i have to have a userparted sub and then compare the user's name with the name in the listview.
any help with this would be greatly appreciated ty
Dim sName as String, i as Integer
For i = 1 to listview.listitems.count
if listview.listitems(i).text = sName Then
listview.listitems.remove(i)
Exit For
End if
Next i
this would remove the item from the listview in vb6, but in .net i cant find anyway of removing an item short of if you have selected it:-\ , i make chat clients on msn-chat and use listview as the names list, therefore i cant just make it so an item is removed by clicking on it, i have to have a userparted sub and then compare the user's name with the name in the listview.
any help with this would be greatly appreciated ty