When a user clicks a checkbox it adds the item to the listbox, and when the user unchecks it, it must be removed from the list. I'm trying to use the FindByText method but it doesn't seem to appear in my visual studio. Here's my current work:
if (checkBox1.Checked == true)
{
listBox1.Items.Add(checkBox1.Text);
}
else
{
listBox1.Items.Remove(listBox1.Items.FindByText(checkBox1.Text));
}