Hey Guys,
I have tried to remove duplicate strings in listview......but have failed any hints tips or help?
All you need to do is compare what you want to add to what is in it @ the current time.
Dim I as Integer
For I = 1 to Listview.ListItems.Count
If LCase(Hm1) <> LCase(Listview.ListItems.Item(I)) Then
'It isnt in the listview. Add it then
End if
Next I
Hm1 is a String and it contains what you want to add to the listview
Edit: I guess your using Visual Basic but if your not then the idea would be the same.
Edit 2: Listviews are only in Visual Basic correct?
Have you tryed setting the sortted propertie to true?
Dupes should then be on top of each other and should beable to be removed by checking the next index with a loop based on the listviews count.
Quote from: DueL on June 27, 2005, 11:32 PMEdit 2: Listviews are only in Visual Basic correct?
No, they're a standard Windows UI control. However, it's still quite likely the OP is using VB, as most C/C++ users capable of populating a listview could've figured out the solution on their own. :)