Assume the ListBox selection mode is MultiSimple or MultiExtended: otherwise, of course, this makes no sense :)
Define a new SelectedObjectCollection, then initialize it in your Form Load Event:
private ListBox.SelectedObjectCollection ListBoxSelections;
private void Form1_Load(object sender, EventArgs e)
{
ListBoxSelections = new ListBox.SelectedObjectCollection(listBox1);
}
Then, 'wire-up' the SelectedIndexChanged Event to your ListBox:
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
ListBoxSelections = listBox1.SelectedItems;
}
And now any time you need to do whatever with the selected items in the ListBox, you can just use 'ListBoxSelections: if its 'Count property == #0, you know there are no current items selected.