Search code examples
c#.netwindowslistbox

How to clear all data in a listBox?


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

Solution

  • What about

    listbox1.Items.Clear();