A better idea just count the element in the combo box and iterate through their index .
private bool checkid(string str )
{
bool k = false;
for (int i = 0; i < cmbmsiid.Items.Count;i++ )
{
if (cmbmsiid.Items[i].ToString() == str)
{
k = true;
break;
}
}
return k;
}
foreach (string email in checkedListBox2.Items)
ReplyDelete{
}
just do it