This is a little snippet I wrote for a project im working on
Anyways here you go.
PHP Code:
public void RemoveListboxDuplicates(ListBox ListBox)
{
List<String> Removed = new List<String>();
for (int I = 0; I < ListBox.Items.Count;I++)
{
if (!Removed.Contains(ListBox.Items[I].ToString()))
{
Removed.Add(ListBox.Items[I].ToString());
}
}
ListBox.Items.Clear();
foreach (String S in Removed)
{
ListBox.Items.Add(S);
}
}
Results 1 to 1 of 1
- 09 Jan. 2011 06:53pm #1
[C#] Remove duplicates from listbox