Hi,
I have the following code
Now, the code checks only the first checkbox and ignores the rest, while I need the code to check all the states and only if no checkboxes are selected to return "select any checkbox".
I have the following code
Code:
int countCheckState = 0 for (int i = 0; i < CheckboxList.Count; i++) { if (CheckboxList[i].Checked) countCheckState++ if (countCheckState == 0) { MessegeBox.Show("select any checkbox"); return; } }
Now, the code checks only the first checkbox and ignores the rest, while I need the code to check all the states and only if no checkboxes are selected to return "select any checkbox".
Comment