Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: UnLeaDeD on June 27, 2005, 11:25 PM

Title: Duplicate Strings in Listview
Post by: UnLeaDeD on June 27, 2005, 11:25 PM
Hey Guys,

I have tried to remove duplicate strings in listview......but have failed any hints tips or help?
Title: Re: Duplicate Strings in Listview
Post by: PaiD on June 27, 2005, 11:32 PM
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?
Title: Re: Duplicate Strings in Listview
Post by: Ringo on June 27, 2005, 11:33 PM
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.
Title: Re: Duplicate Strings in Listview
Post by: Kp on June 27, 2005, 11:52 PM
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. :)