How do you remove an individual item from a listbox?

Recommended Answers

All 2 Replies

int position = ListBox1.SelectedIndex;
    if(position >= 0)
    {
        ListBox1.Items.RemoveAt(position);
    }
    else
    {
        //output message asking the user to select an item from the list
    }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.