Remove Item from ListBox?

Tom picture Tom · Sep 17, 2009 · Viewed 14.5k times · Source

Is there any way to remove item from listbox based on it's name but not index value? I would like to remove item named "Mouse" (which index # changes all the time).

Answer

Mason Wheeler picture Mason Wheeler · Sep 17, 2009
listBox.Items.Delete(listbox.Items.IndexOf('Mouse'));