How to clean Listbox

Asked

Viewed 3,424 times

2

How to clean a ListBox?

I did it this way but it didn’t work:

private void LimparListBox()
{
    //lbxResumo.Text = "";
    lbxResumo.ClearSelected();
}

private void btnLimparList_Click(object sender, EventArgs e)
{
    LimparListBox();
}

2 answers

1


0

The correct command would be:

List.Items.Clear

Put your Listbox name instead of List

The example you used:

lbxResumo.ClearSelected();

clears only the selected item.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.