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
There is LINQ method OfType. Why not use it to get rid of manual type testing and casting?
OfType
foreach (var ctrl in panel.Controls.OfType().Where(x => x.IsChecked) { // .... }