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);
}
}