I have 100 checkbox in a winfrom. Their name is sequential like checkbox1,checkbox2 etc. I have a submit button in my winform. After clicking the submitting button, it check
foreach (var box in this.Controls.OfType()) { if (box.Checked) { //... } else { //... } }