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<
StringRemoved = new List<String>();
    for (
int I 0ListBox.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);
    }

  }