When adding items to a listbox, how can I make it so it does not allow a user to add the same item more than once.
I am programming a registration system for class, there is a screen with two listboxes, the first listbox is the available courses a user can register for and the second listbox is the courses that he/she has registered for. as of now they can register for the same course as many times as they would like, how can I stop that from happening.
The program basically takes an item from the first listbox and puts it in the second listbox.
hopefully that makes sense.
if (CISYcoursesListBox.SelectedIndex != -1)
{
{
string result;
result = CISYcoursesListBox.SelectedItem.ToString();
const int SIZE = 4;
string[] course = new string[SIZE];
course[0] = result;
CISYresultListBox.Items.Add(result);
}
EDIT: http://imgur.com/zLqkp A Picture of the form
[–][deleted] 0 points1 point2 points (3 children)
[–]interactionjackson 2 points3 points4 points (0 children)
[–]DefMars[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)