How to clear all data in a listBox?

Mike picture Mike · Jun 22, 2011 · Viewed 98.8k times · Source

I am after a statement that will clear all strings / data that is currently in a listBox, I have tried:

private void cleanlistbox(object sender, EventArgs e)
{
    listBox1.ResetText();
}

Answer

Ash Burlaczenko picture Ash Burlaczenko · Jun 22, 2011

What about

listbox1.Items.Clear();