Counting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I have a form with 6 checkboxes. What is the best way to count how many
checkboxes have been checked?

Thanks
 
Hi Jez,

You could keep the CheckBoxes in a CheckBox array

int count = 0;
foreach(CheckBox cb in CBArray)
if(cb.Checked)
count++;

Not sure why you would want to know how may CheckBoxes are checked instead
of which ones.
 
Back
Top