private void checkBox1_CheckedChanged(object sender, EventArgs e) { //make the bool array match the check boxes this.Bits[Convert.ToInt32(((CheckBox)sender).Tag)] = ((CheckBox)sender).Checked; }