I have 10 comboboxes with players. In each combobox must be selected one player. Now, I must validate their so, that only one unique player can be selected in combobox.
For example:
combobox1 - Anna
combobox2 - Anna (too)
But if Anna is selected I don't want choose she in another combobox. Or I can show error message on click button "Start Game", that Anna is selected in two comboboxes. The main thing it must be validate. I have only one Idea how I ca validate this and it's not the best way.
if cmbPlayer1.SelectedValue = cmbPlayer2.SelectedValue Or
cmbPlayer1.SelectedValue = cmbPlayer2.SelectedValue Or
...
cmbPlayer1.SelectedValue = cmbPlayer10.SelectedValue
and so for each of ten combobox.
How I can do it better?