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 ctrl in panel.Controls) { if (ctrl is CheckBox && ((CheckBox)ctrl).IsChecked) { //Do Something } }