Is it possible to compare the input text in a textbox in a windows form to the items in a list and then save it if it doesn't exist there.
public Form1()
{
InitializeComponent();
if (txtId.Text == Id.myList)
{
myList.Add(txtId.Text);
}
else (){
MessageBox.Show("Id already exists");
}
}
Pravesh Singh
17-Dec-2013You can loop trough all the items in the list and create a bool variable to check whether you have found the value in the list.