private bool isDuplicate(string newl) { bool found = false; int totitem = ValLstBox.Items.Count; foreach (string item in ValLstBox.Items) { string oldl = item; if (oldl.Equals(newl)) { found = true; break; } } return found; }