I’m building a form application in c#. I have between 6-12 different comboboxes (varying depending on other options specific to this program, but that’s beside the point), each with the same 6 selections.
What would be the easiest way to prevent a user from selecting the same item in more than a single combobox?
What if you were to just create a method to handle the SelectedIndexChanged event for the combo boxes, set them all up to use the same method, and do some quick validation, like so:
Obviously you could make it more efficient by having the List<…> be a private member variable and only set it up once, but I wanted to be succinct and understandable in the sample code.