Q:

Are ListBox.Items and ListBox.SelectedItems linked?

I'm working on a WinForms project, on which there is a TextBox where the user can input a search query, and a ListBox where all items are visible and matched items highlighted.
When I'm iterating through ListBox.Items and modifying ListBox.SelectedItems, I get an InvalidOperationException: List that this enumerator is bound to has been modified. An enumerator can only be used if the list does not change.
Here's the code
private void SearchTextBox_TextChanged(object sender, EventArgs e)
{
    listBox.ClearSelected();

    foreach (var item in listBox.Items) // Exception happens here...
    {
        if (item.ToString().Contains(SearchTextBox.Text))
            listBox.SelectedItems.Add(item); // ... but I'm not modifying listBox.Items
    }
}

I've already thought of a better solution, but I would still like to know why the exception happened.
Is there some kind of link between ListBox.Items and ListBox.SelectedItems, or why does modifying one, make enumerating through the other impossible?

A:

Per MSDN ListBox.Items,
 you would want to add items through the following code:

listbox.Items.Add(); 

EDIT: (I meant to add the following after rereading the ? but my laptop turned off due to low battery)
   listBox1.SetSelected(<index>, true);
   listBox1.SetSelected(<index>, true);
   listBox1.SetSelected(<index>, true);

